mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 12:05:50 +00:00
Add CharToLower and CharToUpper into util.s (#6126)
This commit adds replacement of `::tolower` and `::toupper`. Added CharToLower and CharToUpper routines reduce the number of cast operators that required for correct usage of standard C/C++ `::tolower/toupper` routines.
This commit is contained in:
@@ -94,7 +94,7 @@ class PythonGenerator : public BaseGenerator {
|
||||
// Converts the name of a definition into lower Camel format.
|
||||
std::string MakeLowerCamel(const Definition &definition) const {
|
||||
auto name = MakeCamel(NormalizedName(definition), false);
|
||||
name[0] = char(tolower(name[0]));
|
||||
name[0] = CharToLower(name[0]);
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -1000,7 +1000,7 @@ class PythonGenerator : public BaseGenerator {
|
||||
|
||||
auto field_type_name = TypeName(field);
|
||||
auto one_instance = field_type_name + "_";
|
||||
one_instance[0] = char(tolower(one_instance[0]));
|
||||
one_instance[0] = CharToLower(one_instance[0]);
|
||||
|
||||
if (parser_.opts.include_dependence_headers) {
|
||||
auto package_reference = GenPackageReference(field.value.type);
|
||||
|
||||
Reference in New Issue
Block a user