-
Notifications
You must be signed in to change notification settings - Fork 0
/
Entry.icc
76 lines (57 loc) · 1.68 KB
/
Entry.icc
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// -*- C++ -*-
//
//--------------------------------------------------------------------------------
//
// Michael A.G. Aivazis
// California Institute of Technology
// (C) 1998-2005 All Rights Reserved
//
// <LicenseText>
//
//--------------------------------------------------------------------------------
//
#if !defined(journal_Entry_icc)
#error This header file contains implementation details of the class Entry
#else
// interface
void journal::Entry::newline(journal::Entry::string_t line) {
_text.push_back(line);
return;
}
size_t journal::Entry::lines() const {
return _text.size();
}
journal::Entry::page_t::const_iterator journal::Entry::lineEnd() const {
return _text.end();
}
journal::Entry::page_t::const_iterator journal::Entry::lineBegin() const {
return _text.begin();
}
journal::Entry::meta_t::const_iterator journal::Entry::metaEnd() const {
return _meta.end();
}
journal::Entry::meta_t::const_iterator journal::Entry::metaBegin() const {
return _meta.begin();
}
void journal::Entry::defaultAttributes(const journal::Entry::meta_t & settings) {
_defaults = settings;
return;
}
journal::Entry::string_t & journal::Entry::operator[](journal::Entry::string_t key) {
return _meta[key];
}
journal::Entry::string_t journal::Entry::operator[](journal::Entry::string_t key) const {
meta_t::const_iterator i = _meta.find(key);
if (i != _meta.end()) {
return (*i).second;
}
return string_t();
}
// meta-methods
journal::Entry::Entry() :
_meta(_defaults)
{}
#endif
// version
// $Id: Entry.icc,v 1.1.1.1 2006-11-27 00:09:37 aivazis Exp $
// End of file