ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/Iffy/Tag.hpp
Revision: 276
Committed: 2004-11-13T00:45:59-08:00 (20 years, 7 months ago) by Douglas Thrift
File size: 841 byte(s)
Log Message:
Hmm, I should probably check this in.

File Contents

# Content
1 // Iffy
2 //
3 // Douglas Thrift
4 //
5 // $Id$
6
7 #ifndef _Tag_hpp_
8 #define _Tag_hpp_
9
10 #include "Iffy.hpp"
11
12 enum TagType { OPEN, CLOSE, STANDALONE };
13
14 class Tag
15 {
16 private:
17 TagType type;
18 ext::String name;
19 ios::String attributes;
20 ext::String lower(const ext::String& string);
21 public:
22 Tag(const ext::String& segment);
23 Tag& operator=(TagType type) { this->type = type; return *this; }
24 bool operator==(TagType type) const { return this->type == type; }
25 bool operator==(const ext::String& name) const { return this->name == name; }
26 // friends:
27 friend ios::PrintWriter& operator<<(ios::PrintWriter& pout, const Tag& tag);
28 };
29
30 inline ios::PrintWriter& operator<<(ios::PrintWriter& pout, const Tag& tag)
31 {
32 return pout << (tag.type == CLOSE ? "</" : "<") << tag.name << tag.attributes << (tag.type == STANDALONE ? "/>" : ">");
33 }
34
35 #endif // _Tag_hpp_

Properties

Name Value
svn:eol-style native
svn:keywords Id