imgtools/imglib/parameterfileprocessor/include/parameterfileprocessor.h
changeset 590 360bd6b35136
parent 0 044383f39525
equal deleted inserted replaced
588:c7c26511138f 590:360bd6b35136
    25 #include<iostream>
    25 #include<iostream>
    26 #include<string>
    26 #include<string>
    27 #include<vector>
    27 #include<vector>
    28 #include<fstream>
    28 #include<fstream>
    29 
    29 
    30 typedef std::string String;
    30 using namespace std ;
    31 typedef std::vector<String> VectorOfStrings;
    31 typedef vector<string> VectorOfStrings; 
    32 typedef std::ifstream FileInputStream;
       
    33 
    32 
    34 /**
    33 /**
    35 Class CParameterFileProcessor for processing parameter-file
    34 Class CParameterFileProcessor for processing parameter-file
    36 
    35 
    37 @internalComponent
    36 @internalComponent
    38 @released
    37 @released
    39 */
    38 */
    40 
    39 
    41 class CParameterFileProcessor
    40 class CParameterFileProcessor
    42 {
    41 {
    43 	FileInputStream iParamFile;	 	
    42 	ifstream iParamFile;	 	
    44 	String iParamFileName;		 // Parameter-file name
    43 	string iParamFileName;		 // Parameter-file name
    45 	VectorOfStrings iParameters; // Parameters read from parameter-file
    44 	VectorOfStrings iParameters; // Parameters read from parameter-file
    46 	unsigned int iNoOfArguments; // Number of parameters present in the parameter-file.
    45 	unsigned int iNoOfArguments; // Number of parameters present in the parameter-file.
    47 	char **iParamFileArgs; // Pointer to 2D character array containing the parameters 
    46 	char **iParamFileArgs; // Pointer to 2D character array containing the parameters 
    48 						   // read from parameter-file.	 
    47 						   // read from parameter-file.	 
    49 							   
    48 							   
    50 public:			
    49 public:			
    51 	CParameterFileProcessor(String aParamFileName);	
    50 	CParameterFileProcessor(const string& aParamFileName);	
    52 	bool ParameterFileProcessor();	
    51 	bool ParameterFileProcessor();	
    53 	unsigned int GetNoOfArguments() const;
    52 	unsigned int GetNoOfArguments() const;
    54 	char** GetParameters() const;
    53 	char** GetParameters() const;
    55 	~CParameterFileProcessor();
    54 	~CParameterFileProcessor();
    56 
    55 
    57 private:
    56 private:
    58 	bool OpenFile();
    57 	bool OpenFile();
    59 	bool SplitLine(String& aLine);
    58 	bool SplitLine(string& aLine);
    60 	bool SetNoOfArguments();
    59 	bool SetNoOfArguments();
    61 	void SetParameters();
    60 	void SetParameters();
    62 	void CloseFile();
    61 	void CloseFile();
    63 };	
    62 };	
    64 
    63