-
Paul Reimer authored
Add define/ifdef blocks, alternate sprintf implementation via FLATBUFFERS_PREFER_PRINTF [C++] (#4700) * Add define/ifdef blocks for FLATBUFFERS_PREFER_PRINTF to avoid using std::*streams for idl_parser * Use string::size() as limit in snprintf * Refactored FLATBUFFERS_PREFER_PRINTF guarded feature into NumToStringImplWrapper around sprintf * Remove '.0' where not needed from IntToDigitCount * Remove leading dot from name in GetFullyQualifiedName when FLATBUFFERS_PREFER_PRINTF is enabled * Return string directly from conversion functions where possible when FLATBUFFERS_PREFER_PRINTF is enabled * Use string instead of stringstream for GetFullyQualifiedName * Revert removing leading dot from GetFullyQualifiedName, it does need to be there for parity with the stringstream implementation * Dot is single char in Namespace::GetFullyQualifiedName * Remove trailing (duplicate) null-byte from NumToStringImplWrapper when using FLATBUFFERS_PREFER_PRINTF. * Update preprocessor indenting (and use clang-format off/on) for FLATBUFFERS_PREFER_PRINTF * Reduce whitespace, unneeded braces in FLATBUFFERS_PREFER_PRINTF string width functions * Remove unneeded use of iostream from idl_parser.cpp, std::string is used instead * Tell snprintf to use the trailing null byte expected at the end of std::string buffer
7c1203d4