File.h
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
00022
00023
00024
00025
00026
00031
00035
00037
00038
00039 #ifndef __FILE_H_
00040 #define __FILE_H_
00041
00042 #ifdef MIP_HOST_APPLE
00043 #include <applePatch.h>
00044 #endif
00045
00046 #include <stdio.h>
00047 #include <vector>
00048 #include <iostream>
00049 #include <string>
00050 #include <sstream>
00051 #include <fstream>
00052
00053 #include "LogTrace.h"
00054
00055 using namespace std;
00056
00057
00058
00059
00063 class File : public MIPObject {
00064 private:
00065 string _fileName;
00066 ifstream _file;
00067
00068 public:
00071 File(string name){
00072 _fileName = name;
00073 _file.open(_fileName.c_str(), ifstream::in);
00074
00075 if (!_file.is_open())
00076 {
00077 MIP_WARNING(_fileName << " does not exist!");
00078 }
00079 }
00080
00081 ~File() {
00082 _file.close();
00083 }
00084
00085
00086
00087 static string getFileNameFromPath(string path);
00088
00094 bool allWords(vector<string>& allWordsInFile, bool quotes=true);
00095
00096 string getObjectName() const {
00097 return "File";
00098 }
00099 };
00100
00101
00102
00103
00104
00105 #endif
00106
00107
00108
00109
00110