Changeset 13041 for OpenSceneGraph/trunk/include/osg/ApplicationUsage
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
-
OpenSceneGraph/trunk/include/osg/ApplicationUsage (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osg/ApplicationUsage
r10504 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 26 26 { 27 27 public: 28 28 29 29 static ApplicationUsage* instance(); 30 30 … … 34 34 35 35 typedef std::map<std::string,std::string> UsageMap; 36 36 37 37 38 38 /** The ApplicationName is often displayed when logging errors, and frequently incorporated into the Description (below). */ … … 53 53 HELP_ALL = KEYBOARD_MOUSE_BINDING|ENVIRONMENTAL_VARIABLE|COMMAND_LINE_OPTION 54 54 }; 55 55 56 56 void addUsageExplanation(Type type,const std::string& option,const std::string& explanation); 57 57 58 58 void setCommandLineUsage(const std::string& explanation) { _commandLineUsage=explanation; } 59 59 const std::string& getCommandLineUsage() const { return _commandLineUsage; } … … 61 61 62 62 void addCommandLineOption(const std::string& option,const std::string& explanation, const std::string &defaultValue = ""); 63 63 64 64 void setCommandLineOptions(const UsageMap& usageMap) { _commandLineOptions=usageMap; } 65 65 const UsageMap& getCommandLineOptions() const { return _commandLineOptions; } … … 70 70 71 71 void addEnvironmentalVariable(const std::string& option,const std::string& explanation, const std::string& defaultValue = ""); 72 72 73 73 void setEnvironmentalVariables(const UsageMap& usageMap) { _environmentalVariables=usageMap; } 74 74 const UsageMap& getEnvironmentalVariables() const { return _environmentalVariables; } … … 87 87 88 88 void write(std::ostream& output,const UsageMap& um,unsigned int widthOfOutput=80,bool showDefaults=false,const UsageMap& ud=UsageMap()); 89 89 90 90 void write(std::ostream& output,unsigned int type=COMMAND_LINE_OPTION, unsigned int widthOfOutput=80,bool showDefaults=false); 91 91 … … 93 93 94 94 protected: 95 95 96 96 virtual ~ApplicationUsage() {} 97 97 … … 104 104 UsageMap _environmentalVariablesDefaults; 105 105 UsageMap _commandLineOptionsDefaults; 106 106 107 107 }; 108 108 109 109 class ApplicationUsageProxy 110 { 110 { 111 111 public: 112 112
