Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

FileReadString.h

Go to the documentation of this file.
00001 #ifndef Impala_Basis_FileReadString_h
00002 #define Impala_Basis_FileReadString_h
00003 
00004 #include <vector>
00005 #include "Basis/File.h"
00006 
00007 namespace Impala
00008 {
00009 
00010 
00011 template<class BackInsertIterator>
00012 inline void
00013 FileReadString(BackInsertIterator bi, String fileName, bool skipEC = true,
00014                bool needFile = true)
00015 {
00016     Impala::File f(fileName, "r", needFile);
00017     if (! f.Valid())
00018         return;
00019     while (! f.Eof())
00020     {
00021         String line = f.ReadLine(skipEC);
00022         if (line[0] || !skipEC)
00023             *bi++ = line;
00024     }
00025 }
00026 
00027 inline void
00028 ReadStrings(std::vector<String>& stringList, const String& filename)
00029 {
00030     FileReadString(std::back_inserter(stringList), filename);
00031 }
00032 
00033 
00034 } // namespace Impala
00035 
00036 #endif

Generated on Fri Mar 19 09:30:42 2010 for ImpalaSrc by  doxygen 1.5.1