Logo
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
directory.hh
Go to the documentation of this file.
1 #pragma once
2 #include <string>
3 #include <cstdint>
4 #include <vector>
5 #include "../messages/blockinfo.hh"
6 #include "../messages/fileinfo.hh"
7 #include "blockmetadata.hh"
8 
9 namespace eclipse {
10 using namespace messages;
11 
12 class Directory {
13  public:
14  Directory();
15  void create_tables();
16 
17  void file_table_insert(FileInfo&);
18  void file_table_select(std::string, FileInfo *);
19  void file_table_select_all(std::vector<FileInfo>&);
20  void file_table_update(std::string, uint64_t, uint32_t);
21  void file_table_delete(std::string);
22  bool file_table_exists(std::string);
23  void file_table_confirm_upload (std::string, uint32_t);
24 
25  void block_table_insert(BlockMetadata&);
26  void block_table_insert_all(std::vector<BlockMetadata>&);
27  void block_table_select(std::string, std::vector<BlockMetadata>&);
28  void block_table_select_by_index(std::string, uint32_t, BlockMetadata*);
29  void block_table_select_all(std::vector<BlockMetadata>&);
30  void block_table_update(std::string, uint32_t, uint32_t);
31  void block_table_delete(std::string, uint32_t);
32  void block_table_delete_all(std::string);
33  void select_last_block_metadata(std::string, BlockMetadata*);
34 
35  protected:
36  bool query_exec_simple(char*, int (*)(void*,int,char**,char**), void*);
37 
38  private:
39  std::string path;
40 };
41 
42 }
Definition: fileinfo.hh:10
Definition: directory.hh:12
Definition: blockmetadata.hh:7