Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Domain Class Reference

#include <domain.h>

List of all members.

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)


Member Typedef Documentation

typedef list< string >::const_iterator Domain::iterator<string>
 

Definition at line 24 of file domain.h.


Constructor & Destructor Documentation

Domain::Domain ( ) [inline]
 

Definition at line 11 of file domain.h.

00011 {}

Domain::Domain ( const Domain & d,
unsigned int l )
 

Construct domain that is prefix (of size l) of d.

Definition at line 4 of file domain.C.

00004                                               {
00005 unsigned int m(min(d.size(),n));
00006 list<string>::const_iterator i=d.data().begin();
00007 
00008 for (unsigned int j=1; j<=m; ++j) 
00009   domain_.push_back(*i++);
00010 }


Member Function Documentation

bool Domain::parse ( const string & date_string )
 

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 }

const list< string > & Domain::data<string> ( ) const [inline]
 

Definition at line 18 of file domain.h.

Referenced by Domain(), and operator<<().

00018 { return domain_; }

unsigned int Domain::size ( ) const [inline]
 

Definition at line 19 of file domain.h.

Referenced by Domain(), and DomainExpression::eval().

00019 { return domain_.size(); }

bool Domain::operator== ( const Domain & d ) const [inline]
 

Definition at line 21 of file domain.h.

00021 { return domain_ == d.domain_; }

bool Domain::operator< ( const Domain & d ) const [inline]
 

Definition at line 22 of file domain.h.

00022 { return domain_ < d.domain_; }

iterator Domain::begin ( ) const [inline]
 

Definition at line 25 of file domain.h.

Referenced by DomainExpression::eval().

00025 { return domain_.begin(); }

iterator Domain::end ( ) const [inline]
 

Definition at line 26 of file domain.h.

Referenced by DomainExpression::eval().

00026 { return domain_.end(); }


Friends And Related Function Documentation

ostream & operator<< ( ostream & os,
const Domain & domain ) [friend]
 

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 }


Member Data Documentation

list< string > Domain::domain_<string> [private]
 

Definition at line 30 of file domain.h.


The documentation for this class was generated from the following files:
httpstats-stage03 [ 7 April, 2001]