[Avida-SVN] r2226 - / development/source/main

kaben at myxo.css.msu.edu kaben at myxo.css.msu.edu
Wed Dec 19 12:20:01 PST 2007


Author: kaben
Date: 2007-12-19 15:20:01 -0500 (Wed, 19 Dec 2007)
New Revision: 2226

Modified:
   /
   development/source/main/avida.cc
   development/source/main/avida.h
Log:
 r2185 at vallista:  kaben | 2007-11-04 21:21:30 -0800
 Changes to make Avida easier to test.
 



Property changes on: 
___________________________________________________________________
Name: svk:merge
   - 079b078a-dbed-46b9-b3da-37668d4295ca:/avida/xcode-test:1653
c457ea80-0a68-11dc-9323-a45eea2efad5:/private:2184
   + 079b078a-dbed-46b9-b3da-37668d4295ca:/avida/xcode-test:1653
c457ea80-0a68-11dc-9323-a45eea2efad5:/private:2185

Modified: development/source/main/avida.cc
===================================================================
--- development/source/main/avida.cc	2007-12-19 20:19:54 UTC (rev 2225)
+++ development/source/main/avida.cc	2007-12-19 20:20:01 UTC (rev 2226)
@@ -29,6 +29,7 @@
 #include "cAvidaConfig.h"
 #include "cDriverManager.h"
 #include "cString.h"
+#include "cStringIterator.h"
 #include "tDictionary.h"
 
 
@@ -119,14 +120,19 @@
   cout << "----------------------------------------------------------------------" << endl << endl;
 }
 
-
-void ProcessCmdLineArgs(int argc, char* argv[], cAvidaConfig* cfg)
+void ProcessArgs(cStringList &argv, cAvidaConfig* cfg)
 {
+  int argc = argv.GetSize();
   int arg_num = 1;              // Argument number being looked at.
   
   // Load all of the args into string objects for ease of access.
   cString* args = new cString[argc];
-  for (int i = 0; i < argc; i++) args[i] = argv[i];
+  //for (int i = 0; i < argc; i++) args[i] = argv[i];
+  cStringIterator list_it(argv);
+  for (int i = 0; (i < argc) && (list_it.AtEnd() == false); i++) {
+    list_it.Next();
+    args[i] = list_it.Get();
+  }
   
   cString config_filename = "avida.cfg";
   bool crash_if_not_found = false;
@@ -275,6 +281,14 @@
   
 }
 
+void ProcessCmdLineArgs(int argc, char* argv[], cAvidaConfig* cfg)
+{
+  cStringList sl;
+  for(int i=0; i<argc; i++){
+    sl.PushRear(argv[i]);
+  }
+  ProcessArgs(sl, cfg);
+}
 
 void Exit(int exit_code)
 {

Modified: development/source/main/avida.h
===================================================================
--- development/source/main/avida.h	2007-12-19 20:19:54 UTC (rev 2225)
+++ development/source/main/avida.h	2007-12-19 20:20:01 UTC (rev 2226)
@@ -28,13 +28,14 @@
 
 class cAvidaConfig;
 class cString;
+class cStringList;
 
-
 namespace Avida
 {
   cString GetVersion();
   void PrintVersionBanner();
   
+  void ProcessArgs(cStringList &argv, cAvidaConfig* cfg);
   void ProcessCmdLineArgs(int argc, char* argv[], cAvidaConfig* cfg);
 
   //! This function properly shuts down the Avida program.




More information about the Avida-cvs mailing list