MCPcopy Create free account
hub / github.com/WasmVM/WasmVM / parse_create_path

Function parse_create_path

src/exec/ar.cpp:24–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22using namespace WasmVM;
23
24static std::pair<std::filesystem::path, std::optional<std::filesystem::path>> parse_create_path(std::string str){
25 static const std::regex path_regex("([^:]*)(:(.*))?");
26 std::smatch path_match;
27 if(std::regex_match(str, path_match, path_regex)){
28 std::pair<std::filesystem::path, std::optional<std::filesystem::path>> result;
29 result.first = path_match[1].str();
30 if(path_match[2].length() > 0){
31 result.second = path_match[3].str();
32 }
33 return result;
34 }else{
35 throw Exception::Exception("invalid argument");
36 }
37}
38
39struct CreateConfig {
40

Callers 2

CreateConfigMethod · 0.85
mainFunction · 0.85

Calls 1

ExceptionClass · 0.85

Tested by

no test coverage detected