Updated to the new libmu_cpp.
Showing
8 changed files
with
120 additions
and
112 deletions
1 | /* | 1 | /* |
2 | GNU Mailutils -- a suite of utilities for electronic mail | 2 | GNU Mailutils -- a suite of utilities for electronic mail |
3 | Copyright (C) 2004 Free Software Foundation, Inc. | 3 | Copyright (C) 2004, 2006 Free Software Foundation, Inc. |
4 | 4 | ||
5 | GNU Mailutils is free software; you can redistribute it and/or modify | 5 | GNU Mailutils is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
... | @@ -14,7 +14,8 @@ | ... | @@ -14,7 +14,8 @@ |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with GNU Mailutils; if not, write to the Free Software | 16 | along with GNU Mailutils; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
18 | MA 02110-1301 USA | ||
18 | */ | 19 | */ |
19 | 20 | ||
20 | #include <iostream> | 21 | #include <iostream> |
... | @@ -37,30 +38,30 @@ parse (const char *str) | ... | @@ -37,30 +38,30 @@ parse (const char *str) |
37 | 38 | ||
38 | try { | 39 | try { |
39 | Address address (str); | 40 | Address address (str); |
40 | count = address.GetCount (); | 41 | count = address.getCount (); |
41 | cout << str << "=> count " << count << endl; | 42 | cout << str << "=> count " << count << endl; |
42 | 43 | ||
43 | for (no = 1; no <= count; no++) | 44 | for (no = 1; no <= count; no++) |
44 | { | 45 | { |
45 | bool isgroup = address.IsGroup (no); | 46 | bool isgroup = address.isGroup (no); |
46 | cout << no << " "; | 47 | cout << no << " "; |
47 | 48 | ||
48 | if (isgroup) | 49 | if (isgroup) |
49 | cout << "group " << address.GetPersonal (no) << endl; | 50 | cout << "group " << address.getPersonal (no) << endl; |
50 | else | 51 | else |
51 | cout << "email " << address.GetEmail (no) << endl; | 52 | cout << "email " << address.getEmail (no) << endl; |
52 | 53 | ||
53 | if (!isgroup) | 54 | if (!isgroup) |
54 | cout << " personal " << address.GetPersonal (no) << endl; | 55 | cout << " personal " << address.getPersonal (no) << endl; |
55 | 56 | ||
56 | cout << " comments " << address.GetComments (no) << endl; | 57 | cout << " comments " << address.getComments (no) << endl; |
57 | cout << " local-part " << address.GetLocalPart (no) | 58 | cout << " local-part " << address.getLocalPart (no) |
58 | << " domain " << address.GetDomain (no) << endl; | 59 | << " domain " << address.getDomain (no) << endl; |
59 | cout << " route " << address.GetRoute (no) << endl; | 60 | cout << " route " << address.getRoute (no) << endl; |
60 | } | 61 | } |
61 | } | 62 | } |
62 | catch (Exception& e) { | 63 | catch (Exception& e) { |
63 | cerr << e.Method () << ": " << e.MsgError () << endl; | 64 | cerr << e.method () << ": " << e.msgError () << endl; |
64 | } | 65 | } |
65 | 66 | ||
66 | cout << endl; | 67 | cout << endl; | ... | ... |
1 | /* | 1 | /* |
2 | GNU Mailutils -- a suite of utilities for electronic mail | 2 | GNU Mailutils -- a suite of utilities for electronic mail |
3 | Copyright (C) 2004 Free Software Foundation, Inc. | 3 | Copyright (C) 2004, 2006 Free Software Foundation, Inc. |
4 | 4 | ||
5 | GNU Mailutils is free software; you can redistribute it and/or modify | 5 | GNU Mailutils is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
... | @@ -14,7 +14,8 @@ | ... | @@ -14,7 +14,8 @@ |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with GNU Mailutils; if not, write to the Free Software | 16 | along with GNU Mailutils; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
18 | MA 02110-1301 USA | ||
18 | */ | 19 | */ |
19 | 20 | ||
20 | /* This is an example program to illustrate the use of stream functions. | 21 | /* This is an example program to illustrate the use of stream functions. |
... | @@ -40,10 +41,10 @@ main () | ... | @@ -40,10 +41,10 @@ main () |
40 | 41 | ||
41 | connect_again: | 42 | connect_again: |
42 | try { | 43 | try { |
43 | stream.Open (); | 44 | stream.open (); |
44 | } | 45 | } |
45 | catch (Stream::EAgain) { | 46 | catch (Stream::EAgain) { |
46 | stream.Wait (MU_STREAM_READY_WR); | 47 | stream.wait (MU_STREAM_READY_WR); |
47 | goto connect_again; | 48 | goto connect_again; |
48 | } | 49 | } |
49 | 50 | ||
... | @@ -53,14 +54,14 @@ main () | ... | @@ -53,14 +54,14 @@ main () |
53 | stream << wbuf; | 54 | stream << wbuf; |
54 | } | 55 | } |
55 | catch (Stream::EAgain) { | 56 | catch (Stream::EAgain) { |
56 | stream.Wait (MU_STREAM_READY_WR); | 57 | stream.wait (MU_STREAM_READY_WR); |
57 | off += stream.GetWriten (); | 58 | off += stream.getWriten (); |
58 | goto write_again; | 59 | goto write_again; |
59 | } | 60 | } |
60 | 61 | ||
61 | if (stream.GetWriten () != wbuf.length ()) | 62 | if (stream.getWriten () != wbuf.length ()) |
62 | { | 63 | { |
63 | cerr << "stream.GetWriten() != wbuf length" << endl; | 64 | cerr << "stream.getWriten() != wbuf length" << endl; |
64 | exit (1); | 65 | exit (1); |
65 | } | 66 | } |
66 | 67 | ||
... | @@ -71,15 +72,15 @@ main () | ... | @@ -71,15 +72,15 @@ main () |
71 | stream >> rbuf; | 72 | stream >> rbuf; |
72 | } | 73 | } |
73 | catch (Stream::EAgain) { | 74 | catch (Stream::EAgain) { |
74 | stream.Wait (MU_STREAM_READY_RD); | 75 | stream.wait (MU_STREAM_READY_RD); |
75 | goto read_again; | 76 | goto read_again; |
76 | } | 77 | } |
77 | cout << rbuf.substr (0, stream.GetReadn ()); | 78 | cout << rbuf.substr (0, stream.getReadn ()); |
78 | } | 79 | } |
79 | while (stream.GetReadn ()); | 80 | while (stream.getReadn ()); |
80 | } | 81 | } |
81 | catch (Exception& e) { | 82 | catch (Exception& e) { |
82 | cerr << e.Method () << ": " << e.MsgError () << endl; | 83 | cerr << e.method () << ": " << e.msgError () << endl; |
83 | exit (1); | 84 | exit (1); |
84 | } | 85 | } |
85 | 86 | ... | ... |
1 | /* | 1 | /* |
2 | GNU Mailutils -- a suite of utilities for electronic mail | 2 | GNU Mailutils -- a suite of utilities for electronic mail |
3 | Copyright (C) 2004 Free Software Foundation, Inc. | 3 | Copyright (C) 2004, 2006 Free Software Foundation, Inc. |
4 | 4 | ||
5 | GNU Mailutils is free software; you can redistribute it and/or modify | 5 | GNU Mailutils is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
... | @@ -14,7 +14,8 @@ | ... | @@ -14,7 +14,8 @@ |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with GNU Mailutils; if not, write to the Free Software | 16 | along with GNU Mailutils; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
18 | MA 02110-1301 USA | ||
18 | */ | 19 | */ |
19 | 20 | ||
20 | #include <iostream> | 21 | #include <iostream> |
... | @@ -36,28 +37,28 @@ main (int argc, char **argv) | ... | @@ -36,28 +37,28 @@ main (int argc, char **argv) |
36 | } | 37 | } |
37 | 38 | ||
38 | try { | 39 | try { |
39 | StdioStream *in = new StdioStream(stdin, 0); | 40 | StdioStream *in = new StdioStream (stdin, 0); |
40 | in->Open (); | 41 | in->open (); |
41 | 42 | ||
42 | FilterStream cvt; | 43 | FilterStream cvt; |
43 | cvt.IconvCreate (*in, (string)argv[1], (string)argv[2], 0, mu_fallback_none); | 44 | cvt.iconvCreate (*in, (string)argv[1], (string)argv[2], 0, mu_fallback_none); |
44 | cvt.Open (); | 45 | cvt.open (); |
45 | delete in; | 46 | delete in; |
46 | 47 | ||
47 | StdioStream out (stdout, 0); | 48 | StdioStream out (stdout, 0); |
48 | out.Open (); | 49 | out.open (); |
49 | 50 | ||
50 | do { | 51 | do { |
51 | cvt.Read (buffer, sizeof (buffer), total); | 52 | cvt.read (buffer, sizeof (buffer), total); |
52 | out.SequentialWrite (buffer, cvt.GetReadn ()); | 53 | out.sequentialWrite (buffer, cvt.getReadn ()); |
53 | total += cvt.GetReadn (); | 54 | total += cvt.getReadn (); |
54 | } while (cvt.GetReadn ()); | 55 | } while (cvt.getReadn ()); |
55 | 56 | ||
56 | out.Flush (); | 57 | out.flush (); |
57 | delete in; | 58 | delete in; |
58 | } | 59 | } |
59 | catch (Exception& e) { | 60 | catch (Exception& e) { |
60 | cerr << e.Method () << ": " << e.MsgError () << endl; | 61 | cerr << e.method () << ": " << e.msgError () << endl; |
61 | exit (1); | 62 | exit (1); |
62 | } | 63 | } |
63 | 64 | ... | ... |
1 | /* | 1 | /* |
2 | GNU Mailutils -- a suite of utilities for electronic mail | 2 | GNU Mailutils -- a suite of utilities for electronic mail |
3 | Copyright (C) 2004 Free Software Foundation, Inc. | 3 | Copyright (C) 2004, 2006 Free Software Foundation, Inc. |
4 | 4 | ||
5 | GNU Mailutils is free software; you can redistribute it and/or modify | 5 | GNU Mailutils is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
... | @@ -14,7 +14,8 @@ | ... | @@ -14,7 +14,8 @@ |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with GNU Mailutils; if not, write to the Free Software | 16 | along with GNU Mailutils; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
18 | MA 02110-1301 USA | ||
18 | */ | 19 | */ |
19 | 20 | ||
20 | #include <iostream> | 21 | #include <iostream> |
... | @@ -37,9 +38,9 @@ print (List& lst) | ... | @@ -37,9 +38,9 @@ print (List& lst) |
37 | { | 38 | { |
38 | Iterator itr (lst); | 39 | Iterator itr (lst); |
39 | 40 | ||
40 | for (itr.First (); !itr.IsDone (); itr++) | 41 | for (itr.first (); !itr.isDone (); itr++) |
41 | { | 42 | { |
42 | char* text = (char *) itr.Current (); | 43 | char* text = (char *) itr.current (); |
43 | cout << text << endl; | 44 | cout << text << endl; |
44 | } | 45 | } |
45 | } | 46 | } |
... | @@ -52,7 +53,7 @@ next (Iterator* itr, char *arg) | ... | @@ -52,7 +53,7 @@ next (Iterator* itr, char *arg) |
52 | if (skip == 0) | 53 | if (skip == 0) |
53 | cout << "next arg?" << endl; | 54 | cout << "next arg?" << endl; |
54 | while (skip--) | 55 | while (skip--) |
55 | itr->Next (); | 56 | itr->next (); |
56 | } | 57 | } |
57 | 58 | ||
58 | void | 59 | void |
... | @@ -68,10 +69,10 @@ del (List& lst, int argc, char **argv) | ... | @@ -68,10 +69,10 @@ del (List& lst, int argc, char **argv) |
68 | while (--argc) | 69 | while (--argc) |
69 | { | 70 | { |
70 | try { | 71 | try { |
71 | lst.Remove (strdup (*++argv)); | 72 | lst.remove (strdup (*++argv)); |
72 | } | 73 | } |
73 | catch (Exception& e) { | 74 | catch (Exception& e) { |
74 | cerr << e.Method () << ": " << e.MsgError () << endl; | 75 | cerr << e.method () << ": " << e.msgError () << endl; |
75 | } | 76 | } |
76 | } | 77 | } |
77 | } | 78 | } |
... | @@ -90,10 +91,10 @@ add (List& lst, int argc, char **argv) | ... | @@ -90,10 +91,10 @@ add (List& lst, int argc, char **argv) |
90 | while (--argc) | 91 | while (--argc) |
91 | { | 92 | { |
92 | try { | 93 | try { |
93 | lst.Append (strdup (*++argv)); | 94 | lst.append (strdup (*++argv)); |
94 | } | 95 | } |
95 | catch (Exception& e) { | 96 | catch (Exception& e) { |
96 | cerr << e.Method () << ": " << e.MsgError () << endl; | 97 | cerr << e.method () << ": " << e.msgError () << endl; |
97 | } | 98 | } |
98 | } | 99 | } |
99 | } | 100 | } |
... | @@ -111,10 +112,10 @@ prep (List& lst, int argc, char **argv) | ... | @@ -111,10 +112,10 @@ prep (List& lst, int argc, char **argv) |
111 | while (--argc) | 112 | while (--argc) |
112 | { | 113 | { |
113 | try { | 114 | try { |
114 | lst.Prepend (strdup (*++argv)); | 115 | lst.prepend (strdup (*++argv)); |
115 | } | 116 | } |
116 | catch (Exception& e) { | 117 | catch (Exception& e) { |
117 | cerr << e.Method () << ": " << e.MsgError () << endl; | 118 | cerr << e.method () << ": " << e.msgError () << endl; |
118 | } | 119 | } |
119 | } | 120 | } |
120 | } | 121 | } |
... | @@ -130,10 +131,10 @@ repl (List& lst, int argc, char **argv) | ... | @@ -130,10 +131,10 @@ repl (List& lst, int argc, char **argv) |
130 | } | 131 | } |
131 | 132 | ||
132 | try { | 133 | try { |
133 | lst.Replace (argv[1], strdup (argv[2])); | 134 | lst.replace (argv[1], strdup (argv[2])); |
134 | } | 135 | } |
135 | catch (Exception& e) { | 136 | catch (Exception& e) { |
136 | cerr << e.Method () << ": " << e.MsgError () << endl; | 137 | cerr << e.method () << ": " << e.msgError () << endl; |
137 | } | 138 | } |
138 | } | 139 | } |
139 | 140 | ||
... | @@ -168,23 +169,23 @@ find (Iterator* itr, char* arg) | ... | @@ -168,23 +169,23 @@ find (Iterator* itr, char* arg) |
168 | return; | 169 | return; |
169 | } | 170 | } |
170 | 171 | ||
171 | itr->Current ((void**) &text); | 172 | itr->current ((void**) &text); |
172 | for (itr->First (); !itr->IsDone (); itr->Next ()) | 173 | for (itr->first (); !itr->isDone (); itr->next ()) |
173 | { | 174 | { |
174 | char *item; | 175 | char *item; |
175 | 176 | ||
176 | itr->Current ((void**) &item); | 177 | itr->current ((void**) &item); |
177 | if (!strcmp (arg, item)) | 178 | if (!strcmp (arg, item)) |
178 | return; | 179 | return; |
179 | } | 180 | } |
180 | 181 | ||
181 | cerr << arg << " not in list" << endl; | 182 | cerr << arg << " not in list" << endl; |
182 | 183 | ||
183 | for (itr->First (); !itr->IsDone (); itr->Next ()) | 184 | for (itr->first (); !itr->isDone (); itr->next ()) |
184 | { | 185 | { |
185 | char *item; | 186 | char *item; |
186 | 187 | ||
187 | itr->Current ((void**) &item); | 188 | itr->current ((void**) &item); |
188 | if (!strcmp (text, item)) | 189 | if (!strcmp (text, item)) |
189 | return; | 190 | return; |
190 | } | 191 | } |
... | @@ -217,7 +218,7 @@ shell (List& lst) | ... | @@ -217,7 +218,7 @@ shell (List& lst) |
217 | for (num = 0; num < NITR; num++) | 218 | for (num = 0; num < NITR; num++) |
218 | { | 219 | { |
219 | itr[num] = new Iterator (lst); | 220 | itr[num] = new Iterator (lst); |
220 | itr[num]->First (); | 221 | itr[num]->first (); |
221 | } | 222 | } |
222 | 223 | ||
223 | num = 0; | 224 | num = 0; |
... | @@ -229,26 +230,26 @@ shell (List& lst) | ... | @@ -229,26 +230,26 @@ shell (List& lst) |
229 | char **argv; | 230 | char **argv; |
230 | 231 | ||
231 | try { | 232 | try { |
232 | itr[num]->Current ((void**) &text); | 233 | itr[num]->current ((void**) &text); |
233 | } | 234 | } |
234 | catch (Exception& e) { | 235 | catch (Exception& e) { |
235 | cerr << e.Method () << ": " << e.MsgError () << endl; | 236 | cerr << e.method () << ": " << e.msgError () << endl; |
236 | } | 237 | } |
237 | 238 | ||
238 | cout << num << ":(" << (text ? text : "NULL") << ")> "; | 239 | cout << num << ":(" << (text ? text : "NULL") << ")> "; |
239 | if (cin.getline (buf, sizeof (buf)).eof ()) | 240 | if (cin.getline (buf, sizeof (buf)).eof ()) |
240 | return; | 241 | return; |
241 | 242 | ||
242 | rc = argcv_get (buf, "", "#", &argc, &argv); | 243 | rc = mu_argcv_get (buf, "", "#", &argc, &argv); |
243 | if (rc) | 244 | if (rc) |
244 | cerr << "argcv_get: " << rc << endl; | 245 | cerr << "mu_argcv_get: " << rc << endl; |
245 | 246 | ||
246 | if (argc > 0) | 247 | if (argc > 0) |
247 | { | 248 | { |
248 | if (!strcmp (argv[0], "next")) | 249 | if (!strcmp (argv[0], "next")) |
249 | next (itr[num], argv[1]); | 250 | next (itr[num], argv[1]); |
250 | else if (!strcmp (argv[0], "first")) | 251 | else if (!strcmp (argv[0], "first")) |
251 | itr[num]->First (); | 252 | itr[num]->first (); |
252 | else if (!strcmp (argv[0], "del")) | 253 | else if (!strcmp (argv[0], "del")) |
253 | del (lst, argc, argv); | 254 | del (lst, argc, argv); |
254 | else if (!strcmp (argv[0], "add")) | 255 | else if (!strcmp (argv[0], "add")) |
... | @@ -279,7 +280,7 @@ shell (List& lst) | ... | @@ -279,7 +280,7 @@ shell (List& lst) |
279 | text = (char*) lst[n]; | 280 | text = (char*) lst[n]; |
280 | } | 281 | } |
281 | catch (Exception& e) { | 282 | catch (Exception& e) { |
282 | cerr << e.Method () << ": " << e.MsgError () << endl; | 283 | cerr << e.method () << ": " << e.msgError () << endl; |
283 | } | 284 | } |
284 | 285 | ||
285 | // else | 286 | // else |
... | @@ -289,7 +290,7 @@ shell (List& lst) | ... | @@ -289,7 +290,7 @@ shell (List& lst) |
289 | else | 290 | else |
290 | cerr << "?" << endl; | 291 | cerr << "?" << endl; |
291 | } | 292 | } |
292 | argcv_free (argc, argv); | 293 | mu_argcv_free (argc, argv); |
293 | } | 294 | } |
294 | } | 295 | } |
295 | 296 | ||
... | @@ -319,17 +320,17 @@ main (int argc, char **argv) | ... | @@ -319,17 +320,17 @@ main (int argc, char **argv) |
319 | 320 | ||
320 | try { | 321 | try { |
321 | List lst; | 322 | List lst; |
322 | lst.SetComparator (string_comp); | 323 | lst.setComparator (string_comp); |
323 | 324 | ||
324 | while (argc--) | 325 | while (argc--) |
325 | { | 326 | { |
326 | lst.Append (*argv++); | 327 | lst.append (*argv++); |
327 | } | 328 | } |
328 | 329 | ||
329 | shell (lst); | 330 | shell (lst); |
330 | } | 331 | } |
331 | catch (Exception& e) { | 332 | catch (Exception& e) { |
332 | cerr << e.Method () << ": " << e.MsgError () << endl; | 333 | cerr << e.method () << ": " << e.msgError () << endl; |
333 | } | 334 | } |
334 | 335 | ||
335 | return 0; | 336 | return 0; | ... | ... |
1 | /* | 1 | /* |
2 | GNU Mailutils -- a suite of utilities for electronic mail | 2 | GNU Mailutils -- a suite of utilities for electronic mail |
3 | Copyright (C) 2004 Free Software Foundation, Inc. | 3 | Copyright (C) 2004, 2006 Free Software Foundation, Inc. |
4 | 4 | ||
5 | GNU Mailutils is free software; you can redistribute it and/or modify | 5 | GNU Mailutils is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
... | @@ -14,7 +14,8 @@ | ... | @@ -14,7 +14,8 @@ |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with GNU Mailutils; if not, write to the Free Software | 16 | along with GNU Mailutils; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
18 | MA 02110-1301 USA | ||
18 | */ | 19 | */ |
19 | 20 | ||
20 | #include <iostream> | 21 | #include <iostream> |
... | @@ -31,7 +32,7 @@ main (int argc, char **argv) | ... | @@ -31,7 +32,7 @@ main (int argc, char **argv) |
31 | 32 | ||
32 | try { | 33 | try { |
33 | FileStream stream ((std::string) file, MU_STREAM_READ); | 34 | FileStream stream ((std::string) file, MU_STREAM_READ); |
34 | stream.Open (); | 35 | stream.open (); |
35 | 36 | ||
36 | Mailcap mailcap (stream); | 37 | Mailcap mailcap (stream); |
37 | 38 | ||
... | @@ -39,7 +40,7 @@ main (int argc, char **argv) | ... | @@ -39,7 +40,7 @@ main (int argc, char **argv) |
39 | size_t count = 0; | 40 | size_t count = 0; |
40 | string buffer; | 41 | string buffer; |
41 | 42 | ||
42 | count = mailcap.GetCount (); | 43 | count = mailcap.getCount (); |
43 | for (i = 1; i <= count; i++) | 44 | for (i = 1; i <= count; i++) |
44 | { | 45 | { |
45 | size_t j; | 46 | size_t j; |
... | @@ -47,26 +48,26 @@ main (int argc, char **argv) | ... | @@ -47,26 +48,26 @@ main (int argc, char **argv) |
47 | 48 | ||
48 | cout << "entry[" << i << "]\n"; | 49 | cout << "entry[" << i << "]\n"; |
49 | 50 | ||
50 | MailcapEntry entry = mailcap.GetEntry (i); | 51 | MailcapEntry entry = mailcap.getEntry (i); |
51 | 52 | ||
52 | /* typefield. */ | 53 | /* typefield. */ |
53 | buffer = entry.GetTypeField (); | 54 | buffer = entry.getTypeField (); |
54 | cout << "\ttypefield: " << buffer << endl; | 55 | cout << "\ttypefield: " << buffer << endl; |
55 | 56 | ||
56 | /* view-command. */ | 57 | /* view-command. */ |
57 | buffer = entry.GetViewCommand (); | 58 | buffer = entry.getViewCommand (); |
58 | cout << "\tview-command: " << buffer << endl; | 59 | cout << "\tview-command: " << buffer << endl; |
59 | 60 | ||
60 | /* fields. */ | 61 | /* fields. */ |
61 | fields_count = entry.FieldsCount (); | 62 | fields_count = entry.fieldsCount (); |
62 | for (j = 1; j <= fields_count; j++) | 63 | for (j = 1; j <= fields_count; j++) |
63 | { | 64 | { |
64 | try { | 65 | try { |
65 | buffer = entry.GetField (j); | 66 | buffer = entry.getField (j); |
66 | } | 67 | } |
67 | catch (Exception& e) { | 68 | catch (Exception& e) { |
68 | cerr << e.Method () << ": cannot retrieve field " | 69 | cerr << e.method () << ": cannot retrieve field " |
69 | << j << ": " << e.MsgError () << endl; | 70 | << j << ": " << e.msgError () << endl; |
70 | } | 71 | } |
71 | cout << "\tfields[" << j << "]: " << buffer << endl; | 72 | cout << "\tfields[" << j << "]: " << buffer << endl; |
72 | } | 73 | } |
... | @@ -75,7 +76,7 @@ main (int argc, char **argv) | ... | @@ -75,7 +76,7 @@ main (int argc, char **argv) |
75 | } | 76 | } |
76 | } | 77 | } |
77 | catch (Exception& e) { | 78 | catch (Exception& e) { |
78 | cerr << e.Method () << ": " << e.MsgError () << endl; | 79 | cerr << e.method () << ": " << e.msgError () << endl; |
79 | exit (1); | 80 | exit (1); |
80 | } | 81 | } |
81 | 82 | ... | ... |
1 | /* | 1 | /* |
2 | GNU Mailutils -- a suite of utilities for electronic mail | 2 | GNU Mailutils -- a suite of utilities for electronic mail |
3 | Copyright (C) 2004 Free Software Foundation, Inc. | 3 | Copyright (C) 2004, 2006 Free Software Foundation, Inc. |
4 | 4 | ||
5 | GNU Mailutils is free software; you can redistribute it and/or modify | 5 | GNU Mailutils is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
... | @@ -14,7 +14,8 @@ | ... | @@ -14,7 +14,8 @@ |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with GNU Mailutils; if not, write to the Free Software | 16 | along with GNU Mailutils; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
18 | MA 02110-1301 USA | ||
18 | */ | 19 | */ |
19 | 20 | ||
20 | #include <iostream> | 21 | #include <iostream> |
... | @@ -31,11 +32,11 @@ read_and_print (Stream *in, Stream& out) | ... | @@ -31,11 +32,11 @@ read_and_print (Stream *in, Stream& out) |
31 | { | 32 | { |
32 | char buffer[128]; | 33 | char buffer[128]; |
33 | 34 | ||
34 | in->SequentialReadLine (buffer, sizeof (buffer)); | 35 | in->sequentialReadLine (buffer, sizeof (buffer)); |
35 | while (in->GetReadn ()) | 36 | while (in->getReadn ()) |
36 | { | 37 | { |
37 | out.SequentialWrite (buffer, in->GetReadn ()); | 38 | out.sequentialWrite (buffer, in->getReadn ()); |
38 | in->SequentialReadLine (buffer, sizeof (buffer)); | 39 | in->sequentialReadLine (buffer, sizeof (buffer)); |
39 | } | 40 | } |
40 | } | 41 | } |
41 | 42 | ||
... | @@ -46,21 +47,21 @@ createFilter (bool read_stdin, char *cmdline, int flags) | ... | @@ -46,21 +47,21 @@ createFilter (bool read_stdin, char *cmdline, int flags) |
46 | if (read_stdin) | 47 | if (read_stdin) |
47 | { | 48 | { |
48 | StdioStream *in = new StdioStream (stdin, 0); | 49 | StdioStream *in = new StdioStream (stdin, 0); |
49 | in->Open (); | 50 | in->open (); |
50 | FilterProgStream *stream = new FilterProgStream (cmdline, in); | 51 | FilterProgStream *stream = new FilterProgStream (cmdline, in); |
51 | stream->Open (); | 52 | stream->open (); |
52 | return stream; | 53 | return stream; |
53 | } | 54 | } |
54 | else | 55 | else |
55 | { | 56 | { |
56 | ProgStream *stream = new ProgStream (cmdline, flags); | 57 | ProgStream *stream = new ProgStream (cmdline, flags); |
57 | stream->Open (); | 58 | stream->open (); |
58 | return stream; | 59 | return stream; |
59 | } | 60 | } |
60 | } | 61 | } |
61 | catch (Exception& e) { | 62 | catch (Exception& e) { |
62 | cerr << progname << ": cannot create program filter stream: " | 63 | cerr << progname << ": cannot create program filter stream: " |
63 | << e.Method () << ": " << e.MsgError () << endl; | 64 | << e.method () << ": " << e.msgError () << endl; |
64 | exit (1); | 65 | exit (1); |
65 | } | 66 | } |
66 | } | 67 | } |
... | @@ -89,20 +90,20 @@ main (int argc, char *argv[]) | ... | @@ -89,20 +90,20 @@ main (int argc, char *argv[]) |
89 | exit (1); | 90 | exit (1); |
90 | } | 91 | } |
91 | 92 | ||
92 | argcv_string (argc - i, &argv[i], &cmdline); | 93 | mu_argcv_string (argc - i, &argv[i], &cmdline); |
93 | 94 | ||
94 | stream = createFilter (read_stdin, cmdline, flags); | 95 | stream = createFilter (read_stdin, cmdline, flags); |
95 | 96 | ||
96 | try { | 97 | try { |
97 | StdioStream out (stdout, 0); | 98 | StdioStream out (stdout, 0); |
98 | out.Open (); | 99 | out.open (); |
99 | 100 | ||
100 | read_and_print (stream, out); | 101 | read_and_print (stream, out); |
101 | 102 | ||
102 | delete stream; | 103 | delete stream; |
103 | } | 104 | } |
104 | catch (Exception& e) { | 105 | catch (Exception& e) { |
105 | cerr << e.Method () << ": " << e.MsgError () << endl; | 106 | cerr << e.method () << ": " << e.msgError () << endl; |
106 | exit (1); | 107 | exit (1); |
107 | } | 108 | } |
108 | 109 | ... | ... |
1 | /* | 1 | /* |
2 | GNU Mailutils -- a suite of utilities for electronic mail | 2 | GNU Mailutils -- a suite of utilities for electronic mail |
3 | Copyright (C) 2004 Free Software Foundation, Inc. | 3 | Copyright (C) 2004, 2006 Free Software Foundation, Inc. |
4 | 4 | ||
5 | GNU Mailutils is free software; you can redistribute it and/or modify | 5 | GNU Mailutils is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
... | @@ -14,7 +14,8 @@ | ... | @@ -14,7 +14,8 @@ |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with GNU Mailutils; if not, write to the Free Software | 16 | along with GNU Mailutils; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
18 | MA 02110-1301 USA | ||
18 | */ | 19 | */ |
19 | 20 | ||
20 | #include <iostream> | 21 | #include <iostream> |
... | @@ -33,7 +34,7 @@ int main (int argc, char* argv[]) | ... | @@ -33,7 +34,7 @@ int main (int argc, char* argv[]) |
33 | if (argc == 1) | 34 | if (argc == 1) |
34 | exit (0); | 35 | exit (0); |
35 | 36 | ||
36 | mu_register_local_mbox_formats(); | 37 | mu_register_local_mbox_formats (); |
37 | 38 | ||
38 | Message msg; | 39 | Message msg; |
39 | Header hdr; | 40 | Header hdr; |
... | @@ -42,22 +43,22 @@ int main (int argc, char* argv[]) | ... | @@ -42,22 +43,22 @@ int main (int argc, char* argv[]) |
42 | 43 | ||
43 | MailboxDefault mbox (argv[1]); | 44 | MailboxDefault mbox (argv[1]); |
44 | 45 | ||
45 | mbox.Open (MU_STREAM_READ); | 46 | mbox.open (MU_STREAM_READ); |
46 | total = mbox.MessagesCount (); | 47 | total = mbox.messagesCount (); |
47 | cout << "Total: " << total << endl; | 48 | cout << "Total: " << total << endl; |
48 | 49 | ||
49 | for (int msgno = 1; msgno <= total; msgno++) | 50 | for (int msgno = 1; msgno <= total; msgno++) |
50 | { | 51 | { |
51 | msg = mbox[msgno]; | 52 | msg = mbox[msgno]; |
52 | hdr = msg.GetHeader (); | 53 | hdr = msg.getHeader (); |
53 | cout << hdr[MU_HEADER_FROM] << " " | 54 | cout << hdr[MU_HEADER_FROM] << " " |
54 | << hdr[MU_HEADER_SUBJECT] << endl; | 55 | << hdr[MU_HEADER_SUBJECT] << endl; |
55 | } | 56 | } |
56 | 57 | ||
57 | mbox.Close (); | 58 | mbox.close (); |
58 | } | 59 | } |
59 | catch (Exception& e) { | 60 | catch (Exception& e) { |
60 | cerr << e.Method () << ": " << e.MsgError () << endl; | 61 | cerr << e.method () << ": " << e.msgError () << endl; |
61 | exit (1); | 62 | exit (1); |
62 | } | 63 | } |
63 | 64 | ... | ... |
1 | /* | 1 | /* |
2 | GNU Mailutils -- a suite of utilities for electronic mail | 2 | GNU Mailutils -- a suite of utilities for electronic mail |
3 | Copyright (C) 2004 Free Software Foundation, Inc. | 3 | Copyright (C) 2004, 2006 Free Software Foundation, Inc. |
4 | 4 | ||
5 | GNU Mailutils is free software; you can redistribute it and/or modify | 5 | GNU Mailutils is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
... | @@ -14,7 +14,8 @@ | ... | @@ -14,7 +14,8 @@ |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with GNU Mailutils; if not, write to the Free Software | 16 | along with GNU Mailutils; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
18 | MA 02110-1301 USA | ||
18 | */ | 19 | */ |
19 | 20 | ||
20 | #include <iostream> | 21 | #include <iostream> |
... | @@ -39,19 +40,19 @@ main () | ... | @@ -39,19 +40,19 @@ main () |
39 | 40 | ||
40 | try { | 41 | try { |
41 | Url url (str); | 42 | Url url (str); |
42 | url.Parse (); | 43 | url.parse (); |
43 | 44 | ||
44 | cout << "\tscheme <" << url.GetScheme () << ">" << endl; | 45 | cout << "\tscheme <" << url.getScheme () << ">" << endl; |
45 | cout << "\tuser <" << url.GetUser () << ">" << endl; | 46 | cout << "\tuser <" << url.getUser () << ">" << endl; |
46 | cout << "\tpasswd <" << url.GetPasswd () << ">" << endl; | 47 | cout << "\tpasswd <" << url.getPasswd () << ">" << endl; |
47 | cout << "\tauth <" << url.GetAuth () << ">" << endl; | 48 | cout << "\tauth <" << url.getAuth () << ">" << endl; |
48 | cout << "\thost <" << url.GetHost () << ">" << endl; | 49 | cout << "\thost <" << url.getHost () << ">" << endl; |
49 | cout << "\tport " << url.GetPort () << endl; | 50 | cout << "\tport " << url.getPort () << endl; |
50 | cout << "\tpath <" << url.GetPath () << ">" << endl; | 51 | cout << "\tpath <" << url.getPath () << ">" << endl; |
51 | cout << "\tquery <" << url.GetQuery () << ">" << endl; | 52 | cout << "\tquery <" << url.getQuery () << ">" << endl; |
52 | } | 53 | } |
53 | catch (Exception& e) { | 54 | catch (Exception& e) { |
54 | cerr << e.Method () << ": " << e.MsgError () << endl; | 55 | cerr << e.method () << ": " << e.msgError () << endl; |
55 | goto again; | 56 | goto again; |
56 | } | 57 | } |
57 | } | 58 | } | ... | ... |
-
Please register or sign in to post a comment