17 #include "gxsys/RegularExpression.hxx"
18 #include "gxsys/ios/fstream"
19 #include "gxsys/ios/sstream"
107 gxsys_ios::ifstream file(this->
GetFileName().c_str());
118 bool isLineComment =
false;
120 gxsys::RegularExpression reLineComment;
121 reLineComment.compile(
"^[\\t ]*//");
123 gxsys::RegularExpression reBTX;
124 gxsys::RegularExpression reETX;
125 if (trackBtxEtxLevel)
140 file.getline(line, 4099);
142 isLineComment = reLineComment.find(line);
144 if (trackBtxEtxLevel && reBTX.find(line))
149 this->
Lines.push_back(
LineData(line, isLineComment, btxEtxLevel));
151 if (trackBtxEtxLevel && reETX.find(line))
163 gxsys_stl::ostringstream oss;
165 oss <<
"FileName: " << this->
FileName << gxsys_stl::endl;
168 oss <<
"EndExcludeRegex: " << this->
EndExcludeRegex << gxsys_stl::endl;
170 oss <<
"Lines:" << gxsys_stl::endl;
173 gxsys_stl::vector<LineData>::iterator itLines;
175 for (itLines = this->
Lines.begin(); itLines != this->
Lines.end();
209 gxsys_stl::streamsize w = oss.width();
218 oss <<
": " << line.
Line << gxsys_stl::endl;
223 Trace(oss.str().c_str());
231 return static_cast<unsigned int>(this->
Lines.size());
244 return this->
Lines.at(lineNumber-1).Line;
257 return this->
Lines.at(lineNumber-1).IsLineComment;
270 return this->
Lines.at(lineNumber-1).BtxEtxLevel;
305 unsigned int begin = 0;
306 unsigned int end = 0;
307 unsigned int i = lineNumber;
312 while (0 == end && i>1)
326 while (0 == begin && i>1)
349 "No comment lines prior to line " << lineNumber <<
". Undocumented class or method?");
351 else if (smallestAcceptableLineNumber > begin)
353 block.push_back(std::string(
"//Undocumented Block"));
359 gxsys::RegularExpression reBeginsWithWhiteSpace;
360 reBeginsWithWhiteSpace.compile(
"^([\\t ]*)[^\\t ].*");
364 for (i= begin; i<=end; ++i)
368 if (reBeginsWithWhiteSpace.find(s))
370 from = reBeginsWithWhiteSpace.match(1).size();
371 to = s.size() - from;
372 s = s.substr(from, to);
389 bool foundFirstComment =
false;
391 for (i= 1; i<=n; ++i)
395 foundFirstComment =
true;
397 else if (foundFirstComment)