I have a custom archive structured as follows:
%list% name1 name2 name3 %list%
%dirs% archive directories %dirs%
%content% name1 path1 content of file1 %content%
%content% name2 path2 content of file2 %content%
%content% name3 path3 content of file3 %content%
%list% contains names of files in archive
%dirs% contains names of directories
%content% lists file contents.
Since I need to print the content of a specified file, I want to read this archive word by word, in order to identify %content%
tag and file name.
I know the existence of fscanf()
, but it seems to work efficiently only if you know the archive pattern.
Is there a C library or command, like ifstream
for C++, that allows me to read word by word?