mirror of
https://github.com/openharmony/developtools_global_resource_tool.git
synced 2026-07-18 17:24:42 -04:00
@@ -553,7 +553,7 @@ uint32_t PackageParser::HandleProcess(int c, const string &argValue)
|
||||
{
|
||||
auto handler = handles_.find(c);
|
||||
if (handler == handles_.end()) {
|
||||
cout << "Warning: unsupport " << c << endl;
|
||||
PrintError(GetError(ERR_CODE_UNKNOWN_OPTION).FormatCause(std::to_string(c).c_str()));
|
||||
return RESTOOL_ERROR;
|
||||
}
|
||||
return handler->second(argValue);
|
||||
|
||||
@@ -125,8 +125,8 @@ uint32_t CompressionParser::Init()
|
||||
bool CompressionParser::ParseCompression(const cJSON *compressionNode)
|
||||
{
|
||||
if (!compressionNode) {
|
||||
cout << "Warning: get 'compression' node is empty, the compiled images are not transcoded.";
|
||||
cout << NEW_LINE_PATH << filePath_ << endl;
|
||||
cerr << "Warning: get 'compression' node is empty, the compiled images are not transcoded.";
|
||||
cerr << NEW_LINE_PATH << filePath_ << endl;
|
||||
return true;
|
||||
}
|
||||
if (!cJSON_IsObject(compressionNode)) {
|
||||
@@ -135,8 +135,8 @@ bool CompressionParser::ParseCompression(const cJSON *compressionNode)
|
||||
}
|
||||
cJSON *mediaNode = cJSON_GetObjectItem(compressionNode, "media");
|
||||
if (!mediaNode) {
|
||||
cout << "Warning: get 'media' node is empty, the compiled images are not transcoded.";
|
||||
cout << NEW_LINE_PATH << filePath_ << endl;
|
||||
cerr << "Warning: get 'media' node is empty, the compiled images are not transcoded.";
|
||||
cerr << NEW_LINE_PATH << filePath_ << endl;
|
||||
return true;
|
||||
}
|
||||
if (!cJSON_IsObject(mediaNode)) {
|
||||
@@ -145,8 +145,8 @@ bool CompressionParser::ParseCompression(const cJSON *compressionNode)
|
||||
}
|
||||
cJSON *enableNode = cJSON_GetObjectItem(mediaNode, "enable");
|
||||
if (!enableNode) {
|
||||
cout << "Warning: get 'enable' node is empty, the compiled images are not transcoded.";
|
||||
cout << NEW_LINE_PATH << filePath_ << endl;
|
||||
cerr << "Warning: get 'enable' node is empty, the compiled images are not transcoded.";
|
||||
cerr << NEW_LINE_PATH << filePath_ << endl;
|
||||
return true;
|
||||
}
|
||||
if (!cJSON_IsBool(enableNode)) {
|
||||
|
||||
@@ -135,7 +135,7 @@ bool ConfigParser::SetAppIcon(string &icon, int64_t id)
|
||||
{
|
||||
cJSON *appNode = cJSON_GetObjectItem(root_, "app");
|
||||
if (!appNode || !cJSON_IsObject(appNode)) {
|
||||
cout << "Warning: 'app' not object" << endl;
|
||||
cerr << "Warning: 'app' not object" << endl;
|
||||
return false;
|
||||
}
|
||||
cJSON_AddStringToObject(appNode, "icon", icon.c_str());
|
||||
@@ -147,7 +147,7 @@ bool ConfigParser::SetAppLabel(string &label, int64_t id)
|
||||
{
|
||||
cJSON *appNode = cJSON_GetObjectItem(root_, "app");
|
||||
if (!appNode || !cJSON_IsObject(appNode)) {
|
||||
cout << "Warning: 'app' not object" << endl;
|
||||
cerr << "Warning: 'app' not object" << endl;
|
||||
return false;
|
||||
}
|
||||
cJSON_AddStringToObject(appNode, "label", label.c_str());
|
||||
|
||||
+1
-1
@@ -50,7 +50,7 @@ bool FileEntry::Init()
|
||||
{
|
||||
string filePath = filePath_.GetPath();
|
||||
if (!Exist(filePath)) {
|
||||
cout << "Warning: file not exist: " << filePath << endl;
|
||||
cerr << "Warning: file not exist: " << filePath << endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -104,8 +104,8 @@ uint32_t IdDefinedParser::Init(const string &filePath, bool isSystem)
|
||||
return RESTOOL_ERROR;
|
||||
}
|
||||
if (cJSON_GetArraySize(recordNode) == 0) {
|
||||
cout << "Warning: 'record' node is empty, please check the JSON file.";
|
||||
cout << NEW_LINE_PATH << filePath << endl;
|
||||
cerr << "Warning: 'record' node is empty, please check the JSON file.";
|
||||
cerr << NEW_LINE_PATH << filePath << endl;
|
||||
return RESTOOL_SUCCESS;
|
||||
}
|
||||
int64_t startSysId = 0;
|
||||
|
||||
@@ -72,7 +72,7 @@ void ResourceCheck::CheckNodeInResourceItem(const string &key, const ResourceIte
|
||||
return;
|
||||
}
|
||||
if (width != height) {
|
||||
cout << "Warning: the png width and height not equal" << NEW_LINE_PATH << filePath << endl;
|
||||
cerr << "Warning: the png width and height not equal" << NEW_LINE_PATH << filePath << endl;
|
||||
return;
|
||||
}
|
||||
auto result = g_keyNodeIndexs.find(key);
|
||||
|
||||
@@ -490,8 +490,8 @@ bool ResourceUtil::IsValidName(const string &name)
|
||||
void ResourceUtil::PrintWarningMsg(vector<pair<ResType, string>> &noBaseResource)
|
||||
{
|
||||
for (const auto &item : noBaseResource) {
|
||||
cout << "Warning: the " << ResourceUtil::ResTypeToString(item.first);
|
||||
cout << " of '" << item.second << "' does not have a base resource." << endl;
|
||||
cerr << "Warning: the " << ResourceUtil::ResTypeToString(item.first);
|
||||
cerr << " of '" << item.second << "' does not have a base resource." << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user