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);
46 vector< string > tkDirName;
47 string currentDirName =
"";
51 if(dirName[0] ==
'/') currentDirName +=
"/";
55 for(
unsigned int i = 0;
i < tkDirName.size(); ++
i ){
57 currentDirName += tkDirName[
i];
58 currentDirName +=
"/";
61 stat( currentDirName.c_str(), &mStat );
67 result = mkdir( currentDirName.c_str(), writeMode);
71 result = chmod( currentDirName.c_str(), writeMode);
80 const std::string &
title ){
82 std::fstream fileStream;
86 fileStream <<
"<html>" << std::endl;
87 fileStream <<
"<title>" << std::endl;
88 fileStream << title << std::endl;
89 fileStream <<
"</title>" << std::endl;
90 fileStream <<
"<body>" << std::endl;
91 fileStream <<
"</body>" << std::endl;
92 fileStream <<
"</html>" << std::endl;
98 const std::string &newLine,
99 const std::string &searchLine){
103 std::vector< std::string > fileContents;
104 char lineBuffer[256];
106 std::fstream fileStream;
110 while( fileStream.good() ){
111 fileStream.getline( lineBuffer, 256 );
113 fileContents.push_back( lineBuffer );
115 if( strcmp( lineBuffer, searchLine.c_str() ) == 0 ){
116 fileContents.push_back( newLine );
124 std::fstream fileStream2;
129 fileStream2 << fileContents[
iline] << std::endl;
138 const std::string &newLine,
139 const std::string &searchLine ){
143 std::vector< std::string > fileContents;
144 char lineBuffer[256];
146 std::fstream fileStream;
148 fileStream.open(fileName.c_str());
149 while( fileStream.good() ){
150 fileStream.getline( lineBuffer, 256 );
151 if(strcmp(lineBuffer, searchLine.c_str()) == 0){
152 fileContents.push_back( newLine );
155 fileContents.push_back( lineBuffer );
160 std::fstream fileStream2;
165 fileStream2 << fileContents[
iline] << std::endl;
176 std::fstream filestr;
179 if (filestr.is_open()){