[ scummvm-Patches-1553631 ] scanf for Common::File
SourceForge.net
noreply at sourceforge.net
Wed Sep 6 21:45:42 CEST 2006
Patches item #1553631, was opened at 2006-09-06 22:45
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=1553631&group_id=37116
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Ori Avtalion (salty-horse)
Assigned to: Nobody/Anonymous (nobody)
Summary: scanf for Common::File
Initial Comment:
Attached is an implementation of scanf for the file
class. It is very basic, and may not meet everyone's
needs. It may also be unportable - Are there any C
standards being violated?
The reason for the implementation:
During my fiddlings with the Kingdom O' Magic I needed
to parse large text files. Some of the data in the
files was spread over several lines.
* Using readLine was a bit unreadable since there were
several instances where I called readLine over and over
just to skip lines.
* Reading the entire file into a string and using
sscanf was very slow since sscanf calls strlen() each
and every time. It's very noticable on large files.
Using the new scanf greatly improved the readability
and speed of my text-parsing code.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=1553631&group_id=37116
More information about the Scummvm-tracker
mailing list