MCPcopy Create free account
hub / github.com/BYVoid/OpenCC / RunCommandLineConversion

Function RunCommandLineConversion

src/benchmark/Performance.cpp:513–534  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

511}
512
513void RunCommandLineConversion(const BenchmarkConfig& config,
514 const std::string& input_path,
515 const std::string& output_path,
516 const std::string& measured_result_path) {
517#ifdef OPENCC_BENCHMARK_JIEBA_CONFIG_DIR
518 if (IsJiebaConfig(config)) {
519 SetPluginSearchPath(OPENCC_BENCHMARK_JIEBA_PLUGIN_DIR);
520 }
521#endif
522
523 std::string command = QuotePath(OpenccBinaryPath()) + " -i " +
524 QuotePath(input_path) + " -o " + QuotePath(output_path) +
525 " -c " + QuotePath(config.path) + " --path " +
526 QuotePath(BuildDataDirectory()) + " --path " +
527 QuotePath(SourceConfigDirectory()) +
528 " --measured_result " + QuotePath(measured_result_path);
529 const int status = std::system(WrapSystemCommand(command).c_str());
530 if (status != 0) {
531 throw Exception("opencc command failed with status " +
532 std::to_string(status));
533 }
534}
535
536SimpleConverter* Initialize(const BenchmarkConfig& config) {
537 chdir(PROJECT_BINARY_DIR "/data");

Callers 2

BM_CommandLineLongTextFunction · 0.85
BM_CommandLineFunction · 0.85

Calls 8

IsJiebaConfigFunction · 0.85
SetPluginSearchPathFunction · 0.85
QuotePathFunction · 0.85
OpenccBinaryPathFunction · 0.85
BuildDataDirectoryFunction · 0.85
SourceConfigDirectoryFunction · 0.85
WrapSystemCommandFunction · 0.85
ExceptionFunction · 0.50

Tested by

no test coverage detected