MCPcopy Create free account
hub / github.com/apache/trafficserver / load

Function load

plugins/experimental/access_control/config.cc:130–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

128 */
129template <typename T>
130static bool
131load(T &container, const String &filename)
132{
133 String line;
134 String::size_type pos;
135
136 String path(makeConfigPath(filename));
137
138 AccessControlDebug("reading file %s", path.c_str());
139
140 std::ifstream infile;
141 infile.open(path.c_str());
142 if (!infile.is_open()) {
143 AccessControlError("failed to load file '%s'", path.c_str());
144 return false;
145 }
146
147 while (std::getline(infile, line)) {
148 // Allow #-prefixed comments.
149 pos = line.find_first_of('#');
150 if (pos != String::npos) {
151 line.resize(pos);
152 }
153 if (line.empty()) {
154 continue;
155 }
156
157 loadLine(container, line);
158 }
159 infile.close();
160
161 return true;
162}
163
164/**
165 * @brief initializes plugin configuration.

Callers 15

initMethod · 0.70
readConfigMethod · 0.50
load_configMethod · 0.50
readConfigMethod · 0.50
load_caseMethod · 0.50
loadMethod · 0.50
load_cmpMethod · 0.50
parse_expr_with_modsMethod · 0.50
loadMethod · 0.50
load_caseMethod · 0.50
loadMethod · 0.50

Calls 8

loadLineFunction · 0.85
makeConfigPathFunction · 0.70
c_strMethod · 0.45
openMethod · 0.45
is_openMethod · 0.45
resizeMethod · 0.45
emptyMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected