Formats a single capture range s in text in the form (a,b) where a and b are the starting and ending offsets of s in text.
| 113 | // Formats a single capture range s in text in the form (a,b) |
| 114 | // where a and b are the starting and ending offsets of s in text. |
| 115 | static std::string FormatCapture(const StringPiece& text, |
| 116 | const StringPiece& s) { |
| 117 | if (s.data() == NULL) |
| 118 | return "(?,?)"; |
| 119 | return StringPrintf("(%td,%td)", |
| 120 | s.begin() - text.begin(), |
| 121 | s.end() - text.begin()); |
| 122 | } |
| 123 | |
| 124 | // Returns whether text contains non-ASCII (>= 0x80) bytes. |
| 125 | static bool NonASCII(const StringPiece& text) { |
no test coverage detected