17 std::vector< std::string >& tokens,
18 const std::string& delimiters )
27 while (string::npos != pos || string::npos != lastPos)
30 tokens.push_back(str.substr(lastPos, pos - lastPos));
32 lastPos = str.find_first_not_of(delimiters, pos);
34 pos = str.find_first_of(delimiters, lastPos);
45 vector< string > tkDirName;
46 string currentDirName =
"";
50 if(dirName[0] ==
'/') currentDirName +=
"/";
54 for(
unsigned int i = 0;
i < tkDirName.size(); ++
i ){
56 currentDirName += tkDirName[
i];
57 currentDirName +=
"/";
60 stat( currentDirName.c_str(), &mStat );
66 mkdir( currentDirName.c_str(), writeMode);
70 chmod( currentDirName.c_str(), writeMode);
79 const std::string &
title ){
81 std::fstream fileStream;
85 fileStream <<
"<html>" << std::endl;
86 fileStream <<
"<title>" << std::endl;
87 fileStream << title << std::endl;
88 fileStream <<
"</title>" << std::endl;
89 fileStream <<
"<body>" << std::endl;
90 fileStream <<
"</body>" << std::endl;
91 fileStream <<
"</html>" << std::endl;
97 const std::string &newLine,
98 const std::string &searchLine){
102 std::vector< std::string > fileContents;
103 char lineBuffer[256];
105 std::fstream fileStream;
109 while( fileStream.good() ){
110 fileStream.getline( lineBuffer, 256 );
112 fileContents.push_back( lineBuffer );
114 if( strcmp( lineBuffer, searchLine.c_str() ) == 0 ){
115 fileContents.push_back( newLine );
123 std::fstream fileStream2;
128 fileStream2 << fileContents[
iline] << std::endl;
137 const std::string &newLine,
138 const std::string &searchLine ){
142 std::vector< std::string > fileContents;
143 char lineBuffer[256];
145 std::fstream fileStream;
147 fileStream.open(fileName.c_str());
148 while( fileStream.good() ){
149 fileStream.getline( lineBuffer, 256 );
150 if(strcmp(lineBuffer, searchLine.c_str()) == 0){
151 fileContents.push_back( newLine );
154 fileContents.push_back( lineBuffer );
159 std::fstream fileStream2;
164 fileStream2 << fileContents[
iline] << std::endl;
175 std::fstream filestr;
178 if (filestr.is_open()){