MCPcopy Create free account
hub / github.com/Kitware/CMake / ProcessModule

Method ProcessModule

Source/cmRST.cxx:78–123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76}
77
78void cmRST::ProcessModule(std::istream& is)
79{
80 std::string line;
81 std::string rst;
82 while (cmSystemTools::GetLineFromStream(is, line)) {
83 if (!rst.empty() && rst != "#") {
84 // Bracket mode: check for end bracket
85 std::string::size_type pos = line.find(rst);
86 if (pos == std::string::npos) {
87 this->ProcessLine(line);
88 } else {
89 if (line[0] != '#') {
90 line.resize(pos);
91 this->ProcessLine(line);
92 }
93 rst.clear();
94 this->Reset();
95 this->OutputLinePending = true;
96 }
97 } else {
98 // Line mode: check for .rst start (bracket or line)
99 if (rst == "#") {
100 if (line == "#") {
101 this->ProcessLine("");
102 continue;
103 }
104 if (cmHasLiteralPrefix(line, "# ")) {
105 line.erase(0, 2);
106 this->ProcessLine(line);
107 continue;
108 }
109 rst.clear();
110 this->Reset();
111 this->OutputLinePending = true;
112 }
113 if (line == "#.rst:") {
114 rst = "#";
115 } else if (this->ModuleRST.find(line)) {
116 rst = "]" + this->ModuleRST.match(1) + "]";
117 }
118 }
119 }
120 if (rst == "#") {
121 this->Reset();
122 }
123}
124
125void cmRST::Reset()
126{

Callers 1

ProcessFileMethod · 0.95

Calls 9

ProcessLineMethod · 0.95
ResetMethod · 0.95
cmHasLiteralPrefixFunction · 0.85
eraseMethod · 0.80
emptyMethod · 0.45
findMethod · 0.45
resizeMethod · 0.45
clearMethod · 0.45
matchMethod · 0.45

Tested by

no test coverage detected