MCPcopy Create free account
hub / github.com/WheretIB/nullc / operator()

Method operator()

Colorer.cpp:64–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62 LogError(const char* str): err(str){ }
63
64 void operator() (char const* s, char const* e)
65 {
66 (void)e; // C4100
67 assert(err);
68 logStream << err << "\r\n";
69
70 const char *begin = s;
71 while((begin >= codeStart) && (*begin != '\n') && (*begin != '\r'))
72 begin--;
73 if(begin < s)
74 begin++;
75
76 const char *end = s;
77 while((*end != '\r') && (*end != '\n') && (*end != 0))
78 end++;
79
80 if((end-begin) < 2048)
81 {
82 char line[2048];
83 for(int k = 0; k < (end-begin); k++)
84 {
85 if(begin[k] < 0x20)
86 line[k] = ' ';
87 else
88 line[k] = begin[k];
89 }
90 line[end-begin] = 0;
91 logStream << " at \"" << line << '\"';
92 }else{
93 logStream << " at \"" << std::string(begin,end) << '\"';
94 }
95 logStream << "\r\n ";
96 for(unsigned int i = 0; i < (unsigned int)(s - begin); i++)
97 logStream << ' ';
98 logStream << "^\r\n";
99 }
100 private:
101 const char* err;
102 };

Callers

nothing calls this directly

Calls 1

assertFunction · 0.85

Tested by

no test coverage detected