Loading tools/aapt2/ConfigDescription.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,11 @@ using android::ResTable_config; static const char* kWildcardName = "any"; const ConfigDescription& ConfigDescription::defaultConfig() { static ConfigDescription config = {}; return config; } static bool parseMcc(const char* name, ResTable_config* out) { if (strcmp(name, kWildcardName) == 0) { if (out) out->mcc = 0; Loading tools/aapt2/ConfigDescription.h +5 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,11 @@ namespace aapt { * initialization and comparison methods. */ struct ConfigDescription : public android::ResTable_config { /** * Returns an immutable default config. */ static const ConfigDescription& defaultConfig(); /* * Parse a string of the form 'fr-sw600dp-land' and fill in the * given ResTable_config with resulting configuration parameters. Loading tools/aapt2/Debug.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -210,4 +210,19 @@ void Debug::printStyleGraph(ResourceTable* table, const ResourceName& targetStyl std::cout << "}" << std::endl; } void Debug::dumpHex(const void* data, size_t len) { const uint8_t* d = (const uint8_t*) data; for (size_t i = 0; i < len; i++) { std::cerr << std::hex << std::setfill('0') << std::setw(2) << (uint32_t) d[i] << " "; if (i % 8 == 7) { std::cerr << "\n"; } } if (len - 1 % 8 != 7) { std::cerr << std::endl; } } } // namespace aapt tools/aapt2/Debug.h +4 −0 Original line number Diff line number Diff line Loading @@ -20,12 +20,16 @@ #include "Resource.h" #include "ResourceTable.h" // Include for printf-like debugging. #include <iostream> namespace aapt { struct Debug { static void printTable(ResourceTable* table); static void printStyleGraph(ResourceTable* table, const ResourceName& targetStyle); static void dumpHex(const void* data, size_t len); }; } // namespace aapt Loading tools/aapt2/Flags.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -81,6 +81,8 @@ Flags& Flags::optionalSwitch(const StringPiece& name, const StringPiece& descrip } void Flags::usage(const StringPiece& command, std::ostream* out) { constexpr size_t kWidth = 50; *out << command << " [options]"; for (const Flag& flag : mFlags) { if (flag.required) { Loading @@ -100,11 +102,11 @@ void Flags::usage(const StringPiece& command, std::ostream* out) { // the first line) followed by the description line. This will make sure that multiline // descriptions are still right justified and aligned. for (StringPiece line : util::tokenize<char>(flag.description, '\n')) { *out << " " << std::setw(30) << std::left << argLine << line << "\n"; *out << " " << std::setw(kWidth) << std::left << argLine << line << "\n"; argLine = " "; } } *out << " " << std::setw(30) << std::left << "-h" << "Displays this help menu\n"; *out << " " << std::setw(kWidth) << std::left << "-h" << "Displays this help menu\n"; out->flush(); } Loading Loading
tools/aapt2/ConfigDescription.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -30,6 +30,11 @@ using android::ResTable_config; static const char* kWildcardName = "any"; const ConfigDescription& ConfigDescription::defaultConfig() { static ConfigDescription config = {}; return config; } static bool parseMcc(const char* name, ResTable_config* out) { if (strcmp(name, kWildcardName) == 0) { if (out) out->mcc = 0; Loading
tools/aapt2/ConfigDescription.h +5 −0 Original line number Diff line number Diff line Loading @@ -29,6 +29,11 @@ namespace aapt { * initialization and comparison methods. */ struct ConfigDescription : public android::ResTable_config { /** * Returns an immutable default config. */ static const ConfigDescription& defaultConfig(); /* * Parse a string of the form 'fr-sw600dp-land' and fill in the * given ResTable_config with resulting configuration parameters. Loading
tools/aapt2/Debug.cpp +15 −0 Original line number Diff line number Diff line Loading @@ -210,4 +210,19 @@ void Debug::printStyleGraph(ResourceTable* table, const ResourceName& targetStyl std::cout << "}" << std::endl; } void Debug::dumpHex(const void* data, size_t len) { const uint8_t* d = (const uint8_t*) data; for (size_t i = 0; i < len; i++) { std::cerr << std::hex << std::setfill('0') << std::setw(2) << (uint32_t) d[i] << " "; if (i % 8 == 7) { std::cerr << "\n"; } } if (len - 1 % 8 != 7) { std::cerr << std::endl; } } } // namespace aapt
tools/aapt2/Debug.h +4 −0 Original line number Diff line number Diff line Loading @@ -20,12 +20,16 @@ #include "Resource.h" #include "ResourceTable.h" // Include for printf-like debugging. #include <iostream> namespace aapt { struct Debug { static void printTable(ResourceTable* table); static void printStyleGraph(ResourceTable* table, const ResourceName& targetStyle); static void dumpHex(const void* data, size_t len); }; } // namespace aapt Loading
tools/aapt2/Flags.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -81,6 +81,8 @@ Flags& Flags::optionalSwitch(const StringPiece& name, const StringPiece& descrip } void Flags::usage(const StringPiece& command, std::ostream* out) { constexpr size_t kWidth = 50; *out << command << " [options]"; for (const Flag& flag : mFlags) { if (flag.required) { Loading @@ -100,11 +102,11 @@ void Flags::usage(const StringPiece& command, std::ostream* out) { // the first line) followed by the description line. This will make sure that multiline // descriptions are still right justified and aligned. for (StringPiece line : util::tokenize<char>(flag.description, '\n')) { *out << " " << std::setw(30) << std::left << argLine << line << "\n"; *out << " " << std::setw(kWidth) << std::left << argLine << line << "\n"; argLine = " "; } } *out << " " << std::setw(30) << std::left << "-h" << "Displays this help menu\n"; *out << " " << std::setw(kWidth) << std::left << "-h" << "Displays this help menu\n"; out->flush(); } Loading