/******************************************************************************* * * Copyright (c) 2007, Perforce Software, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL PERFORCE SOFTWARE, INC. BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ******************************************************************************/ #ifndef CONFIGPARSER_H_ #define CONFIGPARSER_H_ #include <iostream> #include <fstream> #include <string> #include <map> #include "configuration.h" #include "Executable.h" class ConfigParser { private: std::string _configFilename; Configuration * _configuration; int _lineno; typedef Executable * (ConfigParser::*exec_ctor)(std::string& name, std::string& type, Configuration * config); typedef std::map<std::string, exec_ctor> ctor_map; ctor_map _constructorMap; public: ConfigParser(const std::string& filename, Configuration * configuration); void parse() throw(ConfigException); bool findVariable(std::string& line, VariableHolder * holder); void findExecutable(std::string& name, std::ifstream& fin); bool eatBracket(std::ifstream& fin, const char * bracket); bool getLine(std::ifstream& fin, std::string& line); Executable * createP4D(std::string& name, std::string& type, Configuration * config); Executable * createP4P(std::string& name, std::string& type, Configuration * config); Executable * createP4WEB(std::string& name, std::string& type, Configuration * config); Executable * createP4FTP(std::string& name, std::string& type, Configuration * config); }; #endif /*CONFIGPARSER_H_*/
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#2 | 5987 | Sven Erik Knop |
Few minor changes: All commands now accept variable called "Options". This can be used to collect all options for which Perforce has not defined an environment variable - for example the undocumented "-C1" for p4d to start a case insensitive server. p4d also accepts the variables P4USER and P4PASSWD. These are only used for stopping the service, which is done first via "p4 admin stop". Note that if the stop via the admin command fails, p4dcfg will stop the service via a kill |
||
#1 | 5882 | Sven Erik Knop | initial publish |