better constant name
This commit is contained in:
@@ -66,7 +66,7 @@ result_t TemParamDataType::readSymbols(size_t offset, size_t length, const Symbo
|
||||
if (outputFormat & OF_JSON) {
|
||||
*output << "null";
|
||||
} else {
|
||||
*output << nullptr_VALUE;
|
||||
*output << NULL_VALUE;
|
||||
}
|
||||
return RESULT_OK;
|
||||
}
|
||||
@@ -94,7 +94,7 @@ result_t TemParamDataType::writeSymbols(const size_t offset, const size_t length
|
||||
unsigned int value;
|
||||
unsigned int grp, num;
|
||||
|
||||
if (input->str() == nullptr_VALUE) {
|
||||
if (input->str() == NULL_VALUE) {
|
||||
value = m_replacement; // replacement value
|
||||
} else {
|
||||
string token;
|
||||
|
||||
@@ -752,7 +752,7 @@ result_t ValueListDataField::readSymbols(const SymbolString& input, size_t offse
|
||||
if (outputFormat & OF_JSON) {
|
||||
*output << "null";
|
||||
} else if (value == m_dataType->getReplacement()) {
|
||||
*output << nullptr_VALUE;
|
||||
*output << NULL_VALUE;
|
||||
}
|
||||
} else if (outputFormat & OF_NUMERIC) {
|
||||
*output << setw(0) << dec << value;
|
||||
@@ -776,7 +776,7 @@ result_t ValueListDataField::writeSymbols(size_t offset, istringstream* input,
|
||||
SymbolString* output, size_t* usedLength) const {
|
||||
const NumberDataType* numType = reinterpret_cast<const NumberDataType*>(m_dataType);
|
||||
const string inputStr = input->str();
|
||||
if (isIgnored() || inputStr == nullptr_VALUE) {
|
||||
if (isIgnored() || inputStr == NULL_VALUE) {
|
||||
// replacement value
|
||||
return numType->writeRawValue(numType->getReplacement(), offset, m_length, output, usedLength);
|
||||
}
|
||||
|
||||
+10
-10
@@ -243,13 +243,13 @@ result_t DateTimeDataType::readSymbols(size_t offset, size_t length, const Symbo
|
||||
case 2: // date only
|
||||
if (!hasFlag(REQ) && symbol == m_replacement) {
|
||||
if (i + 1 != length) {
|
||||
*output << nullptr_VALUE << ".";
|
||||
*output << NULL_VALUE << ".";
|
||||
break;
|
||||
} else if (last == m_replacement) {
|
||||
if (length == 2) { // number of days since 01.01.1900
|
||||
*output << nullptr_VALUE << ".";
|
||||
*output << NULL_VALUE << ".";
|
||||
}
|
||||
*output << nullptr_VALUE;
|
||||
*output << NULL_VALUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -282,13 +282,13 @@ result_t DateTimeDataType::readSymbols(size_t offset, size_t length, const Symbo
|
||||
case 1: // time only
|
||||
if (!hasFlag(REQ) && symbol == m_replacement) {
|
||||
if (length == 1) { // truncated time
|
||||
*output << nullptr_VALUE << ":" << nullptr_VALUE;
|
||||
*output << NULL_VALUE << ":" << NULL_VALUE;
|
||||
break;
|
||||
}
|
||||
if (i > 0) {
|
||||
*output << ":";
|
||||
}
|
||||
*output << nullptr_VALUE;
|
||||
*output << NULL_VALUE;
|
||||
break;
|
||||
}
|
||||
if (hasFlag(SPE)) { // minutes since midnight
|
||||
@@ -378,7 +378,7 @@ result_t DateTimeDataType::writeSymbols(size_t offset, size_t length, istringstr
|
||||
if (input->eof() || !getline(*input, token, '.')) {
|
||||
return RESULT_ERR_EOF; // incomplete
|
||||
}
|
||||
if (!hasFlag(REQ) && token == nullptr_VALUE) {
|
||||
if (!hasFlag(REQ) && token == NULL_VALUE) {
|
||||
value = m_replacement;
|
||||
break;
|
||||
}
|
||||
@@ -431,7 +431,7 @@ result_t DateTimeDataType::writeSymbols(size_t offset, size_t length, istringstr
|
||||
if (input->eof() || !getline(*input, token, LENGTH_SEPARATOR)) {
|
||||
return RESULT_ERR_EOF; // incomplete
|
||||
}
|
||||
if (!hasFlag(REQ) && token == nullptr_VALUE) {
|
||||
if (!hasFlag(REQ) && token == NULL_VALUE) {
|
||||
value = m_replacement;
|
||||
if (length == 1) { // truncated time
|
||||
if (i == 0) {
|
||||
@@ -654,7 +654,7 @@ result_t NumberDataType::readSymbols(size_t offset, size_t length, const SymbolS
|
||||
if (outputFormat & OF_JSON) {
|
||||
*output << "null";
|
||||
} else {
|
||||
*output << nullptr_VALUE;
|
||||
*output << NULL_VALUE;
|
||||
}
|
||||
return RESULT_OK;
|
||||
}
|
||||
@@ -700,7 +700,7 @@ result_t NumberDataType::readSymbols(size_t offset, size_t length, const SymbolS
|
||||
if (outputFormat & OF_JSON) {
|
||||
*output << "null";
|
||||
} else {
|
||||
*output << nullptr_VALUE;
|
||||
*output << NULL_VALUE;
|
||||
}
|
||||
return RESULT_OK;
|
||||
}
|
||||
@@ -806,7 +806,7 @@ result_t NumberDataType::writeSymbols(size_t offset, size_t length, istringstrea
|
||||
unsigned int value;
|
||||
|
||||
const string inputStr = input->str();
|
||||
if (!hasFlag(REQ) && (isIgnored() || inputStr == nullptr_VALUE)) {
|
||||
if (!hasFlag(REQ) && (isIgnored() || inputStr == NULL_VALUE)) {
|
||||
value = m_replacement; // replacement value
|
||||
} else if (inputStr.empty()) {
|
||||
return RESULT_ERR_EOF; // input too short
|
||||
|
||||
@@ -58,7 +58,7 @@ using std::ostringstream;
|
||||
#define LENGTH_SEPARATOR ':'
|
||||
|
||||
/** the replacement string for undefined values (in UI and CSV). */
|
||||
#define nullptr_VALUE "-"
|
||||
#define NULL_VALUE "-"
|
||||
|
||||
/** the separator character used between fields (in UI only). */
|
||||
#define UI_FIELD_SEPARATOR ';'
|
||||
@@ -134,7 +134,7 @@ enum PartType {
|
||||
/** bit flag for @a DataType: fixed width formatting. */
|
||||
#define FIX 0x20
|
||||
|
||||
/** bit flag for @a DataType: value may not be nullptr. */
|
||||
/** bit flag for @a DataType: value may not be NULL. */
|
||||
#define REQ 0x40
|
||||
|
||||
/** bit flag for @a DataType: binary representation is hex converted to decimal and interpreted as 2 digits
|
||||
|
||||
Reference in New Issue
Block a user