MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / ToGuard

Function ToGuard

tensorflow/cc/framework/cc_op_gen.cc:86–100  ·  view source on GitHub ↗

Converts: cc/ops/gen_foo_ops.h to: CC_OPS_GEN_FOO_OPS_H_

Source from the content-addressed store, hash-verified

84// to:
85// CC_OPS_GEN_FOO_OPS_H_
86string ToGuard(const string& path) {
87 string guard;
88 guard.reserve(path.size() + 1); // + 1 -> trailing _
89 for (const char c : path) {
90 if (c >= 'A' && c <= 'Z') {
91 guard += c;
92 } else if (c >= 'a' && c <= 'z') {
93 guard += c + 'A' - 'a';
94 } else {
95 guard += '_';
96 }
97 }
98 guard += '_';
99 return guard;
100}
101
102// Converts: some_name_xyz
103// to: Some Name Xyz

Callers 1

StartFilesFunction · 0.85

Calls 2

reserveMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected