MCPcopy Create free account
hub / github.com/creatale/node-dv / to_string

Method to_string

deps/tesseract/ccutil/unicharset.cpp:1025–1036  ·  view source on GitHub ↗

Returns the string that represents a fragment with the given unichar, pos and total.

Source from the content-addressed store, hash-verified

1023// Returns the string that represents a fragment
1024// with the given unichar, pos and total.
1025STRING CHAR_FRAGMENT::to_string(const char *unichar, int pos, int total,
1026 bool natural) {
1027 if (total == 1) return STRING(unichar);
1028 STRING result = "";
1029 result += kSeparator;
1030 result += unichar;
1031 char buffer[kMaxLen];
1032 snprintf(buffer, kMaxLen, "%c%d%c%d", kSeparator, pos,
1033 natural ? kNaturalFlag : kSeparator, total);
1034 result += buffer;
1035 return result;
1036}
1037
1038CHAR_FRAGMENT *CHAR_FRAGMENT::parse_from_string(const char *string) {
1039 const char *ptr = string;

Callers 3

fragment_state_okayMethod · 0.45
debug_strMethod · 0.45

Calls 1

STRINGClass · 0.70

Tested by

no test coverage detected