3 #include "ArgumentList.h"
8 void ArgumentList::from_string(std::string string
) {
9 /* TODO: support quoted arguments . . . */
10 while(string
.length()) {
11 std::cout
<< "ArgumentList::from_string(): string is \"" << string
<< "\"\n";
12 std::string argument
= string
.substr(0, string
.find(" "));
13 if(string
.find(" ") != std::string::npos
) string
.erase(0, string
.find(" ")+1);
15 add_argument(argument
);
19 char **ArgumentList::get_as_argv() {
22 arguments
= new char *[argument_vector
.size()+1];
24 for(std::size_t x
= 0; x
< argument_vector
.size(); x
++) {
25 arguments
[x
] = new char[std::strlen(argument_vector
[x
].c_str()) + 1];
26 std::strcpy(arguments
[x
], argument_vector
[x
].c_str());
28 arguments
[argument_vector
.size()] = 0;
33 } // namespace Platform
34 } // namespace Aesalon