source: tags/0.91/files_pool.h @ 9

Last change on this file since 9 was 9, checked in by willem, 11 years ago

willem

File size: 1.4 KB
Line 
1
2/*
3   Copyright 2013 Willem Vermin, SURFsara
4
5   Licensed under the Apache License, Version 2.0 (the "License");
6   you may not use this file except in compliance with the License.
7   You may obtain a copy of the License at
8
9       http://www.apache.org/licenses/LICENSE-2.0
10
11   Unless required by applicable law or agreed to in writing, software
12   distributed under the License is distributed on an "AS IS" BASIS,
13   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   See the License for the specific language governing permissions and
15   limitations under the License.
16 */
17#ifndef FILES_POOL_H
18#define FILES_POOL_H
19#include "stopos_pool.h"
20#include "stopos_key.h"
21#include "stopos.h"
22
23class files_pool: public stopos_pool
24{
25
26  private:
27
28    int get_record(std::string &r, const std::string &k, const std::string &l);
29    int put_record(const std::string &r, const std::string &k,const std::string &l);
30    int remove_record(const std::string &k, const std::string &l);
31    int lockfile;
32    std::string lockfilename;
33
34    void create_fname(std::string &fname,const std::string &k);
35
36    const static int NOTDIR = 102;
37
38    std::string key_to_slot(const std::string &k){return "";}
39
40  public:
41    files_pool();
42    void set_db_name(std::string name);
43    int create_db(const std::string &dbname);
44    int purge_db(void);
45    int open_db(void);
46    int close_db(void);
47};
48#endif
Note: See TracBrowser for help on using the repository browser.