Muto 0.0.1
Cross-Platform Application Template
GitHub Repo | Muto Updates | Muto's Author
Loading...
Searching...
No Matches
InstrumentorUtils Namespace Reference

Classes

struct  ChangeResult
 

Functions

template<size_t N, size_t K>
constexpr auto CleanupOutputString (const char(&expr)[N], const char(&remove)[K])
 

Class Documentation

◆ InstrumentorUtils::ChangeResult

struct InstrumentorUtils::ChangeResult
template<size_t N>
struct InstrumentorUtils::ChangeResult< N >
Class Members
char Data[N]

Function Documentation

◆ CleanupOutputString()

template<size_t N, size_t K>
constexpr auto InstrumentorUtils::CleanupOutputString ( const char(&)  expr[N],
const char(&)  remove[K] 
)
constexprprivate
191 {
192 ChangeResult<N> result = {};
193
194 size_t srcIndex = 0;
195 size_t dstIndex = 0;
196 while (srcIndex < N)
197 {
198 size_t matchIndex = 0;
199 while (matchIndex < K - 1 && srcIndex + matchIndex < N - 1 && expr[srcIndex + matchIndex] == remove[matchIndex])
200 matchIndex++;
201 if (matchIndex == K - 1)
202 srcIndex += matchIndex;
203 result.Data[dstIndex++] = expr[srcIndex] == '"' ? '\'' : expr[srcIndex];
204 srcIndex++;
205 }
206 return result;
207 }
char Data[N]
Definition Instrumentor.h:186
Definition Instrumentor.h:185