secureswitools/swisistools/source/scrtool/options.h
changeset 0 ba25891c3a9e
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * COptions - Used to parse command liine options.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 /**
       
    23  @file 
       
    24  @released
       
    25  @internalTechnology
       
    26 */
       
    27 
       
    28 #ifndef DBOPTIONS_H
       
    29 #define DBOPTIONS_H
       
    30 
       
    31 #pragma warning(disable: 4786)
       
    32 
       
    33 #include "logs.h"
       
    34 #include <string>
       
    35 #include <vector>
       
    36 
       
    37 class COptions
       
    38 {
       
    39 	public:
       
    40 		COptions(int aParamsCount, char** aParams);
       
    41 		~COptions();
       
    42 	
       
    43 	public:
       
    44 		std::string GetLogFileName();
       
    45 		CLogger::TLogLevel GetLogLevel();
       
    46 		std::string GetDbFileName();
       
    47 		std::vector<std::string> GetEnvFileNames();
       
    48 		std::string GetPrePovisionFileName();
       
    49 		bool IsDbAbsent();
       
    50 		bool IsPreProvisionInfoAvailable();
       
    51 
       
    52 	private:
       
    53 		void ValidateOptions(int aParamsCount, char** aParams);
       
    54 		void DisplayDetailedUsage();
       
    55 		void DisplayUsage();
       
    56 		void DisplayVersion();
       
    57 		void SetLogLevel(const char* aLogLevel);
       
    58 		void CheckParamExists(int aParamsCount, int aCurrentCount);
       
    59 		bool IsFileAbsent(const char* aFileName);
       
    60 
       
    61 	private:
       
    62 		bool iDbExist;
       
    63 		bool iLoggingEnabled;
       
    64 		bool iPreProvisionUpdate;
       
    65 		std::vector<std::string> iXmlFileNames;
       
    66 		std::string iPreProvisionFileName;
       
    67 		std::string iScrDbName;
       
    68 		CLogger::TLogLevel iLogLevel;
       
    69 		std::string iLogFileName;
       
    70 
       
    71 	private:
       
    72 		static std::string iCurrentVersion;
       
    73 		static std::string iDescription;
       
    74 		static std::string iCopyright;
       
    75 		static std::string iUsage;
       
    76 		static std::string iGeneralInfo;
       
    77 };
       
    78 
       
    79 #endif //DBOPTIONS_H