Q4Wine  2.0
Q4Wine is a Qt GUI for Wine.
dir.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 
39 class Dir : public DBObject {
40  public:
42  Dir();
61  Dir(
62  std::string name,
63  intptr_t prefixId = 0,
64  intptr_t dirId = 0,
65  intptr_t id = 0);
66  ~Dir();
67 
72  virtual bool save(void);
73 
79  static Dir* getInstance(intptr_t id);
80 
81  void setName(std::string name);
82  void setPrefixId(intptr_t prefixId);
83  void setDirId(intptr_t dirId);
84 
85  const std::string getName(void) const;
86  intptr_t getPrefixId(void) const;
87  intptr_t getDirId(void) const;
88 
89  private:
91  static const std::string tableName_;
92  std::string name_;
93  intptr_t prefixId_;
94  intptr_t dirId_;
95 };
96 
97 } // namespace lib
98 } // namespace q4wine
~Dir()
Definition: dir.cpp:40
Describes an abstract interface of object to q4wine db.
Definition: dbobject.hpp:40
void setDirId(intptr_t dirId)
Definition: dir.cpp:106
static Dir * getInstance(intptr_t id)
Create Dir object from DB by version.id.
Definition: dir.cpp:77
Dir()
Definition: dir.cpp:27
void setPrefixId(intptr_t prefixId)
Definition: dir.cpp:102
Describes an virtual directory.
Definition: dir.hpp:39
Definition: db.cpp:23
intptr_t getDirId(void) const
Definition: dir.cpp:118
intptr_t getPrefixId(void) const
Definition: dir.cpp:114
void setName(std::string name)
Definition: dir.cpp:98
const std::string getName(void) const
Definition: dir.cpp:110
virtual bool save(void)
Save Object into DB.
Definition: dir.cpp:44