neoGFX
Cross-platform C++ app/game engine
Loading...
Searching...
No Matches
application_info.hpp
Go to the documentation of this file.
1// application_info.hpp
2/*
3 * Copyright (c) 2007 Leigh Johnston.
4 *
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are
9 * met:
10 *
11 * * Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 *
14 * * Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 *
18 * * Neither the name of Leigh Johnston nor the names of any
19 * other contributors to this software may be used to endorse or
20 * promote products derived from this software without specific prior
21 * written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
24 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
25 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
26 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
27 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
28 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
29 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
30 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
31 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
33 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34*/
35
36#pragma once
37
38#include <neolib/neolib.hpp>
44
45namespace neolib
46{
47 std::string settings_folder(const std::string& aApplicationName, const std::string& aCompanyName);
48
50 {
51 public:
55 public:
56 int argc() const override;
57 char** argv() const override;
58 const vector<string>& as_vector() const override;
59 private:
60 int iArgc;
61 char** iArgv;
62 vector<string> iArguments;
63 };
64
65 class NEOLIB_EXPORT application_info : public i_application_info
66 {
67 public:
69 const std::string& aName = {},
70 const std::string& aCompany = {},
71 const neolib::version& aVersion = neolib::version{},
72 const std::string& aCopyright = {},
73 const std::string& aApplicationFolder = std::string{},
74 const std::string& aSettingsFolder = std::string{},
75 const std::string& aDataFolder = std::string{},
76 const std::string& aPluginExtension = ".plg");
78 int argc, char* argv[],
79 const std::string& aName = {},
80 const std::string& aCompany = {},
81 const neolib::version& aVersion = neolib::version{},
82 const std::string& aCopyright = {},
83 const std::string& aApplicationFolder = std::string{},
84 const std::string& aSettingsFolder = std::string{},
85 const std::string& aDataFolder = std::string{},
86 const std::string& aPluginExtension = ".plg");
88 const program_arguments& aArguments,
89 const std::string& aName = {},
90 const std::string& aCompany = {},
91 const neolib::version& aVersion = neolib::version{},
92 const std::string& aCopyright = {},
93 const std::string& aApplicationFolder = std::string{},
94 const std::string& aSettingsFolder = std::string{},
95 const std::string& aDataFolder = std::string{},
96 const std::string& aPluginExtension = ".plg");
98 public:
99 const program_arguments& arguments() const override;
100 const i_string& name() const override;
101 const i_string& company() const override;
102 const i_version& version() const override;
103 const i_string& copyright() const override;
104 const i_string& application_folder(bool aUseDefault = true) const override;
105 const i_string& settings_folder(bool aUseDefault = true) const override;
106 const i_string& data_folder(bool aUseDefault = true) const override;
107 const i_string& plugin_extension() const override;
108 bool removable() const override;
109 private:
110 program_arguments iArguments;
111 string iName;
112 string iCompany;
113 neolib::version iVersion;
114 string iCopyright;
115 mutable string iDefaultApplicationFolder;
116 mutable string iDefaultSettingsFolder;
117 mutable string iDefaultDataFolder;
118 string iApplicationFolder;
119 string iSettingsFolder;
120 string iDataFolder;
121 string iPluginExtension;
122 bool iRemovable;
123 };
124}
bool removable() const override
const i_string & copyright() const override
application_info(const std::string &aName={}, const std::string &aCompany={}, const neolib::version &aVersion=neolib::version{}, const std::string &aCopyright={}, const std::string &aApplicationFolder=std::string{}, const std::string &aSettingsFolder=std::string{}, const std::string &aDataFolder=std::string{}, const std::string &aPluginExtension=".plg")
const i_string & application_folder(bool aUseDefault=true) const override
const i_string & settings_folder(bool aUseDefault=true) const override
const i_string & company() const override
const i_string & name() const override
const program_arguments & arguments() const override
application_info(const program_arguments &aArguments, const std::string &aName={}, const std::string &aCompany={}, const neolib::version &aVersion=neolib::version{}, const std::string &aCopyright={}, const std::string &aApplicationFolder=std::string{}, const std::string &aSettingsFolder=std::string{}, const std::string &aDataFolder=std::string{}, const std::string &aPluginExtension=".plg")
application_info(const i_application_info &aOther)
const i_string & plugin_extension() const override
application_info(int argc, char *argv[], const std::string &aName={}, const std::string &aCompany={}, const neolib::version &aVersion=neolib::version{}, const std::string &aCopyright={}, const std::string &aApplicationFolder=std::string{}, const std::string &aSettingsFolder=std::string{}, const std::string &aDataFolder=std::string{}, const std::string &aPluginExtension=".plg")
const i_version & version() const override
const i_string & data_folder(bool aUseDefault=true) const override
char ** argv() const override
int argc() const override
const vector< string > & as_vector() const override
program_arguments(const i_program_arguments &aOther)
program_arguments(int argc, char *argv[])
std::string settings_folder(const std::string &aApplicationName, const std::string &aCompanyName)