| 922 | |
| 923 | |
| 924 | void 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; |