199 {
200 const MInt maxNoChars = 1024;
201
202
203 MChar host[maxNoChars];
204 gethostname(host, maxNoChars - 1);
205 host[maxNoChars - 1] = '\0';
206
207
209#if defined(MAIA_MS_COMPILER)
210 constexpr MInt INFO_BUFFER_SIZE = 32767;
211 TCHAR infoBuf[INFO_BUFFER_SIZE];
212 DWORD bufCharCount = INFO_BUFFER_SIZE;
213 if(!GetUserName(infoBuf, &bufCharCount)) {
214 user = "n/a";
215 } else {
216 user = infoBuf;
217 }
218#else
220 p = getpwuid(getuid());
221 if(p) {
223 } else {
224 user = "n/a";
225 }
226#endif
227
228
229 MChar dir[maxNoChars];
230#if defined(MAIA_MS_COMPILER)
231 _getcwd(dir, maxNoChars - 1);
232#else
233 if(!getcwd(dir, maxNoChars - 1)) {
234 TERM(-1);
235 }
236#endif
237 dir[maxNoChars - 1] = '\0';
238
239
240 stringstream executionCommand;
241 executionCommand.str("");
242
243#ifndef PVPLUGIN
247 }
248#else
249 executionCommand << "paraview plugin was started --> no execution command";
250#endif
251
252
253
254 MChar tmpDateTime[128];
255 tm* timeInfo;
256 time_t rawTime;
257
258
259 time(&rawTime);
260
261
262 timeInfo = localtime(&rawTime);
263
264
265 strftime(tmpDateTime, 128, "%Y-%m-%d %H:%M:%S", timeInfo);
266
267
268 ostringstream tmpBuffer;
269
270
271 tmpBuffer << "<?xml version=\"1.0\" standalone=\"yes\" ?>\n";
272 tmpBuffer << "<root>\n";
273 tmpBuffer <<
"<meta name=\"noDomains\" content=\"" <<
m_noDomains <<
"\" />\n";
274 tmpBuffer << "<meta name=\"dateCreation\" content=\"" << tmpDateTime << "\" />\n";
275 tmpBuffer <<
"<meta name=\"fileFormatVersion\" content=\"" <<
m_fileFormatVersion <<
"\" />\n";
276 tmpBuffer <<
"<meta name=\"projectName\" content=\"" <<
m_projectName <<
"\" />\n";
277 tmpBuffer << "<meta name=\"user\" content=\"" << user << "\" />\n";
278 tmpBuffer << "<meta name=\"host\" content=\"" << host << " (" << XSTRINGIFY(MAIA_HOST_STRING) << ")"
279 << "\" />\n";
280 tmpBuffer << "<meta name=\"dir\" content=\"" << dir << "\" />\n";
281 tmpBuffer << "<meta name=\"executionCommand\" content=\"" << executionCommand.str() << "\" />\n";
282 tmpBuffer << "<meta name=\"revision\" content=\"" << XSTRINGIFY(MAIA_VERSION_STRING) << "\" />\n";
283 tmpBuffer << "<meta name=\"build\" content=\"" << XSTRINGIFY(MAIA_COMPILER_STRING) << " "
284 << XSTRINGIFY(MAIA_BUILD_TYPE_STRING) <<
" (" <<
MString(XSTRINGIFY(MAIA_COMPILER_VERSION_STRING)) <<
")"
285 << "\" />\n";
286
287
288
289 return tmpBuffer.str();
290}
static MInt m_argc
Reads the name of the property-file and creates a new Application.
static const MInt m_fileFormatVersion
std::basic_string< char > MString
constexpr std::underlying_type< FcCell >::type p(const FcCell property)
Converts property name to underlying integer value.