Path: blob/trunk/cpp/iedriverserver/CommandLineArguments.h
2867 views
// Licensed to the Software Freedom Conservancy (SFC) under one1// or more contributor license agreements. See the NOTICE file2// distributed with this work for additional information3// regarding copyright ownership. The SFC licenses this file4// to you under the Apache License, Version 2.0 (the "License");5// you may not use this file except in compliance with the License.6// You may obtain a copy of the License at7//8// http://www.apache.org/licenses/LICENSE-2.09//10// Unless required by applicable law or agreed to in writing, software11// distributed under the License is distributed on an "AS IS" BASIS,12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.13// See the License for the specific language governing permissions and14// limitations under the License.1516#ifndef COMMANDLINEARGUMENTS_H_17#define COMMANDLINEARGUMENTS_H_1819#include <algorithm>20#include <map>21#include <string>22#include <vector>2324using namespace std;2526class CommandLineArguments {27public:28CommandLineArguments(int arg_count, _TCHAR* arg_array[]);29virtual ~CommandLineArguments(void);3031std::wstring GetValue(std::wstring arg_name,32std::wstring default_value);33bool is_help_requested(void) const { return this->is_help_requested_; }34bool is_version_requested(void) const { return this->is_version_requested_; }3536private:37void ParseArguments(int argc, _TCHAR* argv[]);38int GetSwitchDelimiterLength(std::wstring arg);3940bool is_help_requested_;41bool is_version_requested_;42std::map<std::wstring, std::wstring> args_map_;43};4445#endif // COMMANDLINEARGUMENTS_H_4647