#include <domain.h>
Public Types | |
typedef list<string>::const_iterator | iterator |
Public Methods | |
Domain () | |
Domain (const Domain &d, unsigned int l) | |
Construct domain that is prefix (of size l) of d. | |
bool | parse (const string &domain_string) |
Note that domain_string may not contain leading or trailing white space. | |
const list<string>& | data () const |
unsigned int | size () const |
bool | operator== (const Domain &d) const |
bool | operator< (const Domain &d) const |
iterator | begin () const |
iterator | end () const |
Private Attributes | |
list<string> | domain_ |
Friends | |
ostream& | operator<< (ostream &,const Domain &domain) |
|
|
|
Definition at line 11 of file domain.h. 00011 {} |
|
Construct domain that is prefix (of size l) of d.
|
|
Note that domain_string may not contain leading or trailing white space.
Definition at line 14 of file domain.C. Referenced by LogRecord::parse_domain(), and Configuration::parse_expression().
00014 { 00015 domain_.clear(); 00016 string::size_type n0(ds.find_first_not_of('.')); 00017 if (n0!=0) 00018 return false; 00019 string::size_type n1(string::npos); 00020 00021 while ((n1 = ds.find_first_of('.',n0)) != string::npos) { 00022 if (n1>n0) 00023 domain_.push_front(ds.substr(n0,n1-n0)); 00024 n0 = n1+1; 00025 } 00026 // If domain does not end with '.', we still need to add a final component. 00027 if (n0<ds.size()) 00028 domain_.push_front(ds.substr(n0)); 00029 return true; 00030 } |
|
Definition at line 18 of file domain.h. Referenced by Domain(), and operator<<().
00018 { return domain_; } |
|
Definition at line 19 of file domain.h. Referenced by Domain(), and DomainExpression::eval().
00019 { return domain_.size(); } |
|
Definition at line 21 of file domain.h. 00021 { return domain_ == d.domain_; } |
|
Definition at line 22 of file domain.h. 00022 { return domain_ < d.domain_; } |
|
Definition at line 25 of file domain.h. Referenced by DomainExpression::eval().
00025 { return domain_.begin(); } |
|
Definition at line 26 of file domain.h. Referenced by DomainExpression::eval().
00026 { return domain_.end(); } |
|
Definition at line 33 of file domain.C. 00033 { 00034 for (list<string>::const_iterator i=d.data().begin(); i!=d.data().end(); ++i) { 00035 if (i!=d.data().begin()) 00036 os << "."; 00037 os << (*i); 00038 } 00039 return os; 00040 } |
|
|