MCPcopy Create free account
hub / github.com/MITK/MITK / generateXmlOutput

Method generateXmlOutput

Modules/CommandLine/src/mitkCommandLineParser.cpp:924–1032  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

922
923
924void mitkCommandLineParser::generateXmlOutput()
925{
926 std::stringstream xml;
927
928 xml << "<executable>" << endl;
929 xml << "<category>" << Category << "</category>" << endl;
930 xml << "<title>" << Title << "</title>" << endl;
931 xml << "<description>" << Description << "</description>" << endl;
932 xml << "<contributor>" << Contributor << "</contributor>" << endl;
933 xml << "<parameters>" << endl;
934
935 std::vector<CommandLineParserArgumentDescription *>::iterator it;
936
937 std::string lastParameterGroup = "";
938 for (it = this->Internal->ArgumentDescriptionList.begin(); it != this->Internal->ArgumentDescriptionList.end(); it++)
939 {
940 std::string type;
941 switch ((*it)->ValueType)
942 {
943 case mitkCommandLineParser::String:
944 type = "string";
945 break;
946
947 case mitkCommandLineParser::Bool:
948 type = "boolean";
949 break;
950
951 case mitkCommandLineParser::StringList:
952 type = "string-vector";
953 break;
954
955 case mitkCommandLineParser::Int:
956 type = "integer";
957 break;
958
959 case mitkCommandLineParser::Float:
960 type = "float";
961 break;
962
963 case mitkCommandLineParser::Directory:
964 type = "directory";
965 break;
966
967 case mitkCommandLineParser::Image:
968 type = "image";
969 break;
970
971 case mitkCommandLineParser::File:
972 type = "file";
973 break;
974 }
975
976 if (lastParameterGroup.compare((*it)->ArgGroup))
977 {
978 if (it != this->Internal->ArgumentDescriptionList.begin())
979 {
980 xml << "</parameters>" << endl;
981 xml << "<parameters>" << endl;

Callers 1

parseArgumentsMethod · 0.95

Calls 5

EmptyMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected