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
00049 string get_file_extension(const string &filename);
00050
00051 FILE * open_file_stream(const string &input_file_name);
00052 istream * open_file_istream(const string &filename);
00053 istream * open_file_istream_or_error(const string &filename);
00054 istream * open_data_file_istream(const string &path, const string &filename,
00055 const string &start = start_path);
00056 FILE * open_data_file_stream(const string &path, const string &filename,
00057 const string &start = start_path);
00058 bool read_line(istream *in, string &line);
00059 string get_file_path(const string &s);
00060 bool contains_path(const string &);
00061 string strip_file_path(const string &);
00062 string get_input_file_name(const string &file_name);
00063
00064 }
00065
00066 #endif //_FILEUTIL_H