MCPcopy Create free account
hub / github.com/apache/nifi-minifi-cpp / readYAML

Function readYAML

libminifi/test/Server.cpp:283–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281}
282
283int readYAML(char **ymlContent) {
284 std::ifstream is("conf/flowServer.yml", std::ifstream::binary);
285 if (is) {
286 // get length of file:
287 is.seekg(0, is.end);
288 int length = is.tellg();
289 is.seekg(0, is.beg);
290
291 char * buffer = new char[length];
292
293 printf("Reading %s len %d\n", "conf/flowServer.yml", length);
294 // read data as a block:
295 is.read(buffer, length);
296
297 is.close();
298
299 // ...buffer contains the entire file...
300 *ymlContent = buffer;
301
302 return length;
303 }
304 return 0;
305}
306
307static int sockfd = 0, newsockfd = 0;
308void sigHandler(int signal) {

Callers 1

mainFunction · 0.85

Calls 2

readMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected