AMROC Main     Blockstructured Adaptive Mesh Refinement in object-oriented C++


Main Page   Class Hierarchy   Compound List   File List  

command-line.C

Go to the documentation of this file.
00001 
00006 /* #include "Iso-std/sstream" */
00007 #include "IO/command-line.h"
00008 
00009 Commandline::Commandline(int argc, char* argv[]) : commands("") {
00010   //  ostringstream cmds;
00011   ostrstream cmds;
00012   for(int i = 1; i < argc; ++i)
00013     cmds << argv[i] << " ";
00014   cmds << '\n' << '\0';
00015   int n = strlen(cmds.str());
00016   char* copy = new char[n+1];
00017   strcpy(copy,cmds.str());
00018   commands = string(copy);
00019 }
00020 
00021 //istringstream Commandline::get() const { return istringstream(commands);}
00022 //strstream Commandline::get() const { return strstream(commands.c_str());}
00023 const char* Commandline::c_str() const { 
00024   char* copy = new char[strlen(commands.c_str())+1];
00025   strcpy(copy,commands.c_str());
00026   return copy;
00027 }


Quickstart     Users Guide     Programmers Reference     Installation      Examples     Download



AMROC Main      Home      Contact
last update: 06/01/04