Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __CS_CSUTIL_FILEREADHELPER_H__
00022 #define __CS_CSUTIL_FILEREADHELPER_H__
00023
00028 #include "csextern.h"
00029 #include "csutil/ref.h"
00030 #include "iutil/vfs.h"
00031
00035 class CS_CRYSTALSPACE_EXPORT csFileReadHelper
00036 {
00037 csRef<iFile> file;
00038 public:
00043 csFileReadHelper (iFile* file) : file (file) {}
00044
00046 iFile* GetFile() { return file; }
00047
00049 void Skip (size_t num) { file->SetPos (file->GetPos() + num); }
00050
00060 bool ReadInt8 (int8 &val);
00061 bool ReadUInt8 (uint8 &val);
00062 bool ReadInt16 (int16 &val);
00063 bool ReadUInt16 (uint16 &val);
00064 bool ReadInt32 (int32 &val);
00065 bool ReadUInt32 (uint32 &val);
00067
00071
00072 int GetChar ();
00074 int LookChar ();
00083 bool GetString (char* buf, size_t len, bool OmitNewline = true);
00087 int ReadTextInt ();
00091 float ReadTextFloat ();
00095 void SkipWhitespace ();
00097 };
00098
00099 #endif // __CS_CSUTIL_FILEREADHELPER_H__