This repository has been archived by the owner on Jan 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BibString.h
55 lines (43 loc) · 1.5 KB
/
BibString.h
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
52
53
54
55
#ifndef _BIB_STRING_H_
#define _BIB_STRING_H_
#include <string>
namespace CBibTeX
{
// TODO: 20170124 use UNICODE.
//typedef std::string BibString;
class BibString
{
private:
std::string _data;
public:
//********** 类内类型 **********//
typedef std::string::size_type SizeType;
typedef std::string::difference_type DifferenceType;
//********** 构造函数 **********//
BibString();
BibString(const char*);
BibString(const std::string&);
BibString(const BibString&, const SizeType&, const DifferenceType&);
//********** 析构函数 **********//
// TODO: 20170202 目前为空
~BibString();
//********** 成员字段 **********//
const SizeType npos = (SizeType)(-1);
//********** 常量成员函数 **********//
const char* cString() const;
SizeType findCharacter(const char& ch, const SizeType& beginPos = 0) const;
bool isEmpty() const;
// 不使用 length()
const SizeType size() const;
//********** 非常量成员函数 **********//
void erase(const SizeType&, const DifferenceType&);
void deleteLeftRightSpace();
void toUpperCase();
//********** 运算符 **********//
BibString operator=(const BibString&);
BibString operator+=(const char&);
char operator[](const SizeType&) const;
bool operator==(const BibString&) const;
};
}
#endif