新增右键菜单适配

Signed-off-by: fangyunzhong <fangyunzhong2@huawei.com>
This commit is contained in:
fangyunzhong
2023-10-20 06:08:42 +00:00
parent b3a1a4f298
commit 31d6253beb
4 changed files with 10 additions and 9 deletions
+1 -1
View File
@@ -39,7 +39,7 @@ const static std::string LONG_PATH_HEAD = "\\\\?\\";
const static std::string ID_DEFINED_INDENTATION = " ";
const static int32_t VERSION_MAX_LEN = 128;
const static int32_t INT_TO_BYTES = sizeof(uint32_t);
static const int8_t RESTOOL_VERSION[VERSION_MAX_LEN] = { "Restool 4.101" };
static const int8_t RESTOOL_VERSION[VERSION_MAX_LEN] = { "Restool 4.102" };
const static int32_t TAG_LEN = 4;
enum class KeyType {
+6 -6
View File
@@ -392,7 +392,7 @@ uint32_t PackageParser::HandleProcess(int c, const string& argValue)
{
auto handler = handles_.find(c);
if (handler == handles_.end()) {
cout << "Error: unsupport " << c << endl;
cerr << "Error: unsupport " << c << endl;
return RESTOOL_ERROR;
}
return handler->second(argValue);
@@ -420,7 +420,7 @@ uint32_t PackageParser::ParseCommand(int argc, char *argv[])
if (optIndex != -1) {
string curOpt = (optarg == nullptr) ? argv[optind - 1] : argv[optind - 2];
if (curOpt != ("--" + string(CMD_OPTS[optIndex].name))) {
cout << "Error: unknown option " << curOpt << endl;
cerr << "Error: unknown option " << curOpt << endl;
return RESTOOL_ERROR;
}
}
@@ -432,19 +432,19 @@ uint32_t PackageParser::ParseCommand(int argc, char *argv[])
for (int i = optind; i < argc; i++) {
errmsg.append(argv[i]).append(" ");
}
cout << errmsg << endl;
cerr << errmsg << endl;
return RESTOOL_ERROR;
}
if (c == Option::UNKNOWN) {
string optUnknown = (optopt == 0) ? argv[optind - 1] : ("-" + string(1, optopt));
cout << "Error: unknown option " << optUnknown << endl;
cerr << "Error: unknown option " << optUnknown << endl;
return RESTOOL_ERROR;
}
if (c == Option::NO_ARGUMENT) {
if (IsLongOpt(argv)) {
cout << "Error: option " << argv[optind - 1] << " must have argument" << endl;
cerr << "Error: option " << argv[optind - 1] << " must have argument" << endl;
} else {
cout << "Error: unknown option " << argv[optind - 1] << endl;
cerr << "Error: unknown option " << argv[optind - 1] << endl;
}
return RESTOOL_ERROR;
}
+2 -1
View File
@@ -39,7 +39,8 @@ const map<string, string> ConfigParser::JSON_STRING_IDS = {
{ "startWindowIcon", "^\\$media:" },
{ "startWindowBackground", "^\\$color:"},
{ "resource", "^\\$[a-z]+:" },
{ "extra", "^\\$[a-z]+:" }
{ "extra", "^\\$[a-z]+:" },
{ "fileContextMenu", "^\\profile:" }
};
const map<string, string> ConfigParser::JSON_ARRAY_IDS = {
+1 -1
View File
@@ -52,7 +52,7 @@ uint32_t IResourceCompiler::Compile(const vector<DirectoryInfo> &directoryInfos)
}
if (!it->IsFile()) {
cout << "Error: '" << it->GetFilePath().GetPath() << "' must be a file." << endl;
cerr << "Error: '" << it->GetFilePath().GetPath() << "' must be a file." << endl;
return RESTOOL_ERROR;
}