MCPcopy Create free account
hub / github.com/baldurk/renderdoc / Parse

Method Parse

renderdoccmd/renderdoccmd.cpp:933–1017  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

931 virtual bool IsInternalOnly() { return true; }
932 virtual bool IsCaptureCommand() { return false; }
933 virtual bool Parse(cmdline::parser &parser, GlobalEnvironment &)
934 {
935 cmdopts.DecodeFromString(conv(parser.get<std::string>("capopts")));
936
937 std::vector<std::string> rest = parser.rest();
938
939 parser.set_rest({});
940
941 if(rest.size() % 3 != 0)
942 {
943 std::cerr << "Invalid generated capaltbit command rest.size() == " << rest.size() << std::endl;
944 return false;
945 }
946
947 int numEnvs = int(rest.size() / 3);
948
949 env.reserve(numEnvs);
950
951 for(int i = 0; i < numEnvs; i++)
952 {
953 std::string typeString = rest[i * 3 + 0];
954
955 EnvMod type = EnvMod::Set;
956 EnvSep sep = EnvSep::NoSep;
957
958 if(typeString == "+env-replace")
959 {
960 type = EnvMod::Set;
961 sep = EnvSep::NoSep;
962 }
963 else if(typeString == "+env-append-platform")
964 {
965 type = EnvMod::Append;
966 sep = EnvSep::Platform;
967 }
968 else if(typeString == "+env-append-semicolon")
969 {
970 type = EnvMod::Append;
971 sep = EnvSep::SemiColon;
972 }
973 else if(typeString == "+env-append-colon")
974 {
975 type = EnvMod::Append;
976 sep = EnvSep::Colon;
977 }
978 else if(typeString == "+env-append")
979 {
980 type = EnvMod::Append;
981 sep = EnvSep::NoSep;
982 }
983 else if(typeString == "+env-prepend-platform")
984 {
985 type = EnvMod::Prepend;
986 sep = EnvSep::Platform;
987 }
988 else if(typeString == "+env-prepend-semicolon")
989 {
990 type = EnvMod::Prepend;

Callers

nothing calls this directly

Calls 6

set_restMethod · 0.80
convFunction · 0.70
sizeMethod · 0.45
reserveMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected