49 addArgument(*it);
50 };
51 }
52 } while (0);
53
54 do {
55 const CfgFile::Properties::const_iterator classpath = appOptions.find(
56 PropertyName::classpath);
57 if (classpath != appOptions.end()) {
58 addArgument(_T("-classpath"));
59 addArgument(CfgFile::asPathList(*classpath));
60 }
61 } while (0);
62
63 do {
64 const CfgFile::Properties::const_iterator splash = appOptions.find(
65 PropertyName::splash);
66 if (splash != appOptions.end()) {
67 const tstring splashPath = CfgFile::asString(*splash);
68 if (FileUtils::isFileExists(splashPath)) {
69 addArgument(_T("-splash"));
70 addArgument(splashPath);
71 } else {
72 LOG_WARNING(tstrings::any()
73 << "Splash property ignored. File \""
74 << splashPath << "\" not found");
75 }
76 }
77 } while (0);
78
79 do {
80 const CfgFile::Properties& section = cfgFile.getProperties(
81 SectionName::JavaOptions);
82 const CfgFile::Properties::const_iterator javaOptions = section.find(
83 PropertyName::javaOptions);
84 if (javaOptions != section.end()) {
85 tstring_array::const_iterator it = javaOptions->second.begin();
86 const tstring_array::const_iterator end = javaOptions->second.end();
87 for (; it != end; ++it) {
88 addArgument(*it);
89 };
90 }
118 addArgument(_T("-jar"));
119 addArgument(CfgFile::asString(*mainjar));
120 }
121 } while (0);
122
123 do {
124 const CfgFile::Properties& section = cfgFile.getProperties(
125 SectionName::ArgOptions);
126 const CfgFile::Properties::const_iterator arguments = section.find(
127 PropertyName::arguments);
128 if (arguments != section.end()) {
129 tstring_array::const_iterator it = arguments->second.begin();
130 const tstring_array::const_iterator end = arguments->second.end();
131 for (; it != end; ++it) {
132 addArgument(*it);
133 };
134 }
135 } while (0);
136
137 return *this;
138 }
139
140
141 namespace {
142 void convertArgs(const std::vector<std::string>& args, std::vector<char*>& argv) {
143 argv.reserve(args.size() + 1);
144 argv.resize(0);
145
146 std::vector<std::string>::const_iterator it = args.begin();
147 const std::vector<std::string>::const_iterator end = args.end();
148
149 for (; it != end; ++it) {
150 argv.push_back(const_cast<char*>(it->c_str()));
151 };
152
153 // Add treminal '0'.
154 argv.push_back(0);
155 }
156 } // namespace
157
|
49 addArgument(*it);
50 };
51 }
52 } while (0);
53
54 do {
55 const CfgFile::Properties::const_iterator classpath = appOptions.find(
56 PropertyName::classpath);
57 if (classpath != appOptions.end()) {
58 addArgument(_T("-classpath"));
59 addArgument(CfgFile::asPathList(*classpath));
60 }
61 } while (0);
62
63 do {
64 const CfgFile::Properties::const_iterator splash = appOptions.find(
65 PropertyName::splash);
66 if (splash != appOptions.end()) {
67 const tstring splashPath = CfgFile::asString(*splash);
68 if (FileUtils::isFileExists(splashPath)) {
69 addArgument(_T("-splash:") + splashPath);
70 } else {
71 LOG_WARNING(tstrings::any()
72 << "Splash property ignored. File \""
73 << splashPath << "\" not found");
74 }
75 }
76 } while (0);
77
78 do {
79 const CfgFile::Properties& section = cfgFile.getProperties(
80 SectionName::JavaOptions);
81 const CfgFile::Properties::const_iterator javaOptions = section.find(
82 PropertyName::javaOptions);
83 if (javaOptions != section.end()) {
84 tstring_array::const_iterator it = javaOptions->second.begin();
85 const tstring_array::const_iterator end = javaOptions->second.end();
86 for (; it != end; ++it) {
87 addArgument(*it);
88 };
89 }
117 addArgument(_T("-jar"));
118 addArgument(CfgFile::asString(*mainjar));
119 }
120 } while (0);
121
122 do {
123 const CfgFile::Properties& section = cfgFile.getProperties(
124 SectionName::ArgOptions);
125 const CfgFile::Properties::const_iterator arguments = section.find(
126 PropertyName::arguments);
127 if (arguments != section.end()) {
128 tstring_array::const_iterator it = arguments->second.begin();
129 const tstring_array::const_iterator end = arguments->second.end();
130 for (; it != end; ++it) {
131 addArgument(*it);
132 };
133 }
134 } while (0);
135
136 return *this;
137 }
138
139
140 bool Jvm::isWithSplash() const {
141 tstring_array::const_iterator it = args.begin();
142 const tstring_array::const_iterator end = args.end();
143 for (; it != end; ++it) {
144 if (tstrings::startsWith(*it, _T("-splash:"))) {
145 return true;
146 }
147 }
148 return false;
149 }
150
151
152 namespace {
153 void convertArgs(const std::vector<std::string>& args, std::vector<char*>& argv) {
154 argv.reserve(args.size() + 1);
155 argv.resize(0);
156
157 std::vector<std::string>::const_iterator it = args.begin();
158 const std::vector<std::string>::const_iterator end = args.end();
159
160 for (; it != end; ++it) {
161 argv.push_back(const_cast<char*>(it->c_str()));
162 };
163
164 // Add treminal '0'.
165 argv.push_back(0);
166 }
167 } // namespace
168
|