00001
00002
00003
00004
00005
00006
00007 #ifndef _FILEUTIL_H
00008 #define _FILEUTIL_H
00009
00010 #include <iostream>
00011 #include <string>
00012 #include "ioexception.h"
00013
00014 using std::istream;
00015 using std::string;
00016
00017 namespace srchilite {
00018
00019 extern std::string start_path;
00020
00028 string readFile(const string &fileName) throw (IOException);
00029
00030
00031
00040 string createOutputFileName(const string &inputFileName,
00041 const string &outputDir, const string &ext);
00042
00047 unsigned int get_line_count(istream &input);
00048
00053 string get_file_extension(const string &filename);
00054
00055 FILE * open_file_stream(const string &input_file_name);
00056 istream * open_file_istream(const string &filename);
00057 istream * open_file_istream_or_error(const string &filename);
00058 istream * open_data_file_istream(const string &path, const string &filename,
00059 const string &start = start_path);
00060 FILE * open_data_file_stream(const string &path, const string &filename,
00061 const string &start = start_path);
00062 bool read_line(istream *in, string &line);
00063 string get_file_path(const string &s);
00064 bool contains_path(const string &);
00065 string strip_file_path(const string &);
00066 string get_input_file_name(const string &file_name);
00067
00068 }
00069
00070 #endif //_FILEUTIL_H