MCPcopy Create free account
hub / github.com/apache/brpc / FileDumper

Method FileDumper

src/bvar/variable.cpp:569–583  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

567class FileDumper : public Dumper {
568public:
569 FileDumper(const std::string& filename, butil::StringPiece s/*prefix*/)
570 : _filename(filename), _fp(NULL) {
571 // setting prefix.
572 // remove trailing spaces.
573 const char* p = s.data() + s.size();
574 for (; p != s.data() && isspace(p[-1]); --p) {}
575 s.remove_suffix(s.data() + s.size() - p);
576 // normalize it.
577 if (!s.empty()) {
578 to_underscored_name(&_prefix, s);
579 if (butil::back_char(_prefix) != '_') {
580 _prefix.push_back('_');
581 }
582 }
583 }
584
585 ~FileDumper() {
586 close();

Callers

nothing calls this directly

Calls 7

to_underscored_nameFunction · 0.85
back_charFunction · 0.85
remove_suffixMethod · 0.80
dataMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected