Q4Wine  2.0
Q4Wine is a Qt GUI for Wine.
wineversion.hpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2008-2016 by Alexey S. Malakhov <brezerk@gmail.com> *
3  * *
4  * This program is free software: you can redistribute it and/or modify *
5  * it under the terms of the GNU General Public License as published by *
6  * the Free Software Foundation, either version 3 of the License, or *
7  * (at your option) any later version. *
8  * *
9  * This program is distributed in the hope that it will be useful, *
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12  * GNU General Public License for more details. *
13  * *
14  * You should have received a copy of the GNU General Public License *
15  * along with this program. If not, see <http://www.gnu.org/licenses/>. *
16  * *
17  ***************************************************************************/
18 
19 #pragma once
20 
21 #include <stdint.h>
22 
23 #include <iostream>
24 #include <memory>
25 #include <string>
26 #include <sstream>
27 
28 #include "src/lib/defines.hpp"
29 #include "src/lib/dbobject.hpp"
30 
31 namespace q4wine {
32 namespace lib {
33 
51 class WineVersion : public DBObject {
52  public:
54  WineVersion();
94  std::string name,
95  std::string binary,
96  std::string server = std::string(),
97  std::string loader = std::string(),
98  std::string libs32 = std::string(),
99  std::string libs64 = std::string(),
100  intptr_t id = 0);
101  ~WineVersion();
102 
107  virtual bool save(void);
108 
114  static WineVersion* getInstance(intptr_t id);
115 
128  const std::string getEnvVariables(const std::string arch) const;
129 
130  void setName(std::string name);
131  void setBinary(std::string binary);
132  void setServer(std::string server);
133  void setLoader(std::string loader);
134  void setLibs32(std::string libs32);
135  void setLibs64(std::string libs64);
136 
137  const std::string getName(void) const;
138  const std::string getBinary(void) const;
139  const std::string getServer(void) const;
140  const std::string getLoader(void) const;
141  const std::string getLibs32(void) const;
142  const std::string getLibs64(void) const;
144  const std::string getLibs(const std::string arch) const;
145 
146  private:
148  static const std::string tableName_;
149  std::string name_;
150  std::string binary_;
151  std::string server_;
152  std::string loader_;
153  std::string libs32_;
154  std::string libs64_;
155 };
156 
157 } // namespace lib
158 } // namespace q4wine
Describes an abstract interface of object to q4wine db.
Definition: dbobject.hpp:40
void setLibs64(std::string libs64)
Definition: wineversion.cpp:131
const std::string getLibs64(void) const
Definition: wineversion.cpp:155
virtual bool save(void)
Object into DB.
Definition: wineversion.cpp:50
const std::string getEnvVariables(const std::string arch) const
Definition: wineversion.cpp:98
const std::string getBinary(void) const
Definition: wineversion.cpp:139
const std::string getLibs32(void) const
Definition: wineversion.cpp:151
void setBinary(std::string binary)
Definition: wineversion.cpp:115
void setName(std::string name)
Definition: wineversion.cpp:111
const std::string getLibs(const std::string arch) const
Definition: wineversion.cpp:159
Definition: db.cpp:23
void setLoader(std::string loader)
Definition: wineversion.cpp:119
void setLibs32(std::string libs32)
Definition: wineversion.cpp:127
void setServer(std::string server)
Definition: wineversion.cpp:123
static WineVersion * getInstance(intptr_t id)
Create WineVersion object from DB by version.id.
Definition: wineversion.cpp:81
const std::string getServer(void) const
Definition: wineversion.cpp:147
const std::string getName(void) const
Definition: wineversion.cpp:135
Describes a wine version configuration.
Definition: wineversion.hpp:51
WineVersion()
Definition: wineversion.cpp:27
const std::string getLoader(void) const
Definition: wineversion.cpp:143
~WineVersion()
Definition: wineversion.cpp:46