Revert "[ion] Namespace Ion::UTF8Helper and Ion::UTF8Decoder"

This reverts commit 23da0d3f2c.
This commit is contained in:
Émilie Feral
2019-05-03 16:29:28 +02:00
parent 72d8fdd4a5
commit 8b926612a2
39 changed files with 129 additions and 145 deletions

View File

@@ -67,15 +67,15 @@ CartesianFunction CartesianFunction::NewModel(Ion::Storage::Record::ErrorStatus
int CartesianFunction::derivativeNameWithArgument(char * buffer, size_t bufferSize, CodePoint arg) {
// Fill buffer with f(x). Keep size for derivative sign.
int derivativeSize = Ion::UTF8Decoder::CharSizeOfCodePoint('\'');
int derivativeSize = UTF8Decoder::CharSizeOfCodePoint('\'');
int numberOfChars = nameWithArgument(buffer, bufferSize - derivativeSize, arg);
assert(numberOfChars + derivativeSize < bufferSize);
char * firstParenthesis = const_cast<char *>(Ion::UTF8Helper::CodePointSearch(buffer, '('));
if (!Ion::UTF8Helper::CodePointIs(firstParenthesis, '(')) {
char * firstParenthesis = const_cast<char *>(UTF8Helper::CodePointSearch(buffer, '('));
if (!UTF8Helper::CodePointIs(firstParenthesis, '(')) {
return numberOfChars;
}
memmove(firstParenthesis + derivativeSize, firstParenthesis, buffer + numberOfChars - firstParenthesis);
Ion::UTF8Decoder::CodePointToChars('\'', firstParenthesis, derivativeSize);
UTF8Decoder::CodePointToChars('\'', firstParenthesis, derivativeSize);
return numberOfChars + derivativeSize;
}