phonedb.h
880 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef PHONEDB_H
#define PHONEDB_H
#include "jxmlparser.h"
#include <string>
#include <iostream>
#include <iostream>
#include <sstream>
using namespace jcommon;
namespace mtel {
class PhoneDB{
public:
struct phone_t{
std::string name;
std::string phone1;
std::string phone2;
};
private:
std::vector<phone_t> events;
std::string _file;
public:
PhoneDB(std::string file);
virtual ~PhoneDB();
bool Load();
bool Save();
int GetCapacity();
int GetSize();
struct PhoneDB::phone_t * Get(int i);
bool IsFull();
bool IsEmpty();
bool Add(std::string name, std::string phone1, std::string phone2);
int Find(std::string name, std::string phone1, std::string phone2);
int Search(std::string name);
bool Update(int i, std::string name, std::string phone1, std::string phone2);
void Remove(int i);
void RemoveAll();
};
}
#endif