1
/***************************************************************************
4
begin : Tue May 15 14:30:02 GMT-5 2001
5
copyright : (C) 2001 by ejoy
6
email : ejoy@user.sourceforge.net
7
***************************************************************************/
9
/***************************************************************************
11
* This program is free software; you can redistribute it and/or modify *
12
* it under the terms of the GNU General Public License as published by *
13
* the Free Software Foundation; either version 2 of the License, or *
14
* (at your option) any later version. *
16
***************************************************************************/
39
Word::Word(const Word& w) {
44
bool operator<(const Word& w1,const Word& w2) {
45
return w1.mCode < w2.mCode;
48
bool operator==(const Word& w1,const Word& w2) {
49
return (w1.mCode == w2.mCode && w1.mText == w2.mText);
53
void ParseHead(istream& in,ostream& out);
54
void ParseText(istream& in,ostream& out);
55
void WriteOption(ostream& out,string& o,string& v);
56
void ParseOption(string& s,string& o,string& v);
58
int main(int argc, char *argv[])
65
void ParseOption(string& s,string& o,string& v) {
66
const char* p = s.c_str();
73
while (*p == ' ' || *p == '=')
75
while (*p && *p != ' ')
79
void ParseHead(istream& in,ostream& out) {
82
out << "[Description]" << endl;
86
if (lines >= 28 && lines < 34)
89
break; //text area reached
100
void WriteOption(ostream& out,string& o,string& v) {
102
out << "Name=" << v << endl;
103
else if (o == "��Ԫ��")
104
out << "UsedCodes=" << v << endl;
105
else if (o == "���ܼ�")
106
out << "WildChar=" << v << endl;
107
else if (o == "����볤")
108
out << "MaxCodes=" << v << endl;
110
void ParseText(istream& in,ostream& out) {
111
out << "[Text]" << endl;
113
deque<class Word> list;
114
unsigned const char *p;
119
p = (unsigned const char *)s.c_str();
121
while (*p != ' ' && *p < 0xa1)
128
while (*p && *p != ' ' && *p != '*') {
132
while (*p && (*p == ' ' || *p == '*') )
140
stable_sort(list.begin(),list.end());
141
deque<class Word>::iterator w;
143
for (w = list.begin();w != list.end();w++)
144
out<<w->mText<<w->mCode<<endl;