From 5589ff23c2becc51ffbfc984c1d475ddf3032753 Mon Sep 17 00:00:00 2001 From: arjen Date: Mon, 4 Nov 2002 07:24:31 +0000 Subject: [PATCH] Use proper namespace for iostream classes --- demos/acltest.cpp | 17 ++++++++++------- demos/testaxe.cpp | 6 +++--- src/amount.cpp | 13 ++++++++----- src/display.h | 11 +++++++---- src/font.cpp | 11 +++++++---- src/font.h | 13 ++++++++----- src/integer.cpp | 13 ++++++++----- src/integer.h | 15 +++++++++------ src/money.h | 15 +++++++++------ src/pixmap.h | 11 +++++++---- 10 files changed, 76 insertions(+), 49 deletions(-) diff --git a/demos/acltest.cpp b/demos/acltest.cpp index 46743a9..c577a61 100644 --- a/demos/acltest.cpp +++ b/demos/acltest.cpp @@ -5,7 +5,7 @@ *********************** ** FILE NAME : acltest.cpp ** SYSTEM NAME : AXE - Andromeda X-windows Encapsulation -** VERSION NUMBER : $Revision: 1.5 $ +** VERSION NUMBER : $Revision: 1.6 $ ** ** DESCRIPTION : Test routine for non-X classes ** @@ -22,7 +22,10 @@ /***************************** $Log: acltest.cpp,v $ - Revision 1.5 2002-11-03 13:19:33 arjen + Revision 1.6 2002-11-04 07:25:00 arjen + Use proper namespace for iostream classes + + Revision 1.5 2002/11/03 13:19:33 arjen New functions - String::escape() and String::unescape() Revision 1.4 2002/09/26 14:48:46 arjen @@ -40,7 +43,7 @@ *****************************/ -static const char *RCSID = "$Id: acltest.cpp,v 1.5 2002-11-03 13:19:33 arjen Exp $"; +static const char *RCSID = "$Id: acltest.cpp,v 1.6 2002-11-04 07:25:00 arjen Exp $"; #include "String.h" #include "integer.h" @@ -96,10 +99,10 @@ int main() std::cout << x << " >> 3 = " << y << "\n"; std::cout << "\nInput a string:\n"; - cin >> hello; + std::cin >> hello; std::cout << hello << "\n\n"; std::cout << "\nAnd another one:\n"; - cin >> pattern; + std::cin >> pattern; std::cout << pattern << "\n\n"; std::cout << "Second string found at position " << pattern.in(hello); std::cout << " of first string.\n"; @@ -142,7 +145,7 @@ int main() String datestring; - cin >> datestring; + std::cin >> datestring; d2 = date(datestring); std::cout << datestring << " parses into (DD-MM-YYYY): " << d2 << "\n"; @@ -177,7 +180,7 @@ int main() std::cout << "With 10,50,30: " << t1 << "\n"; std::cout << "Enter a time: \n"; - cin >> datestring; + std::cin >> datestring; t2 = hour(datestring); std::cout << datestring << " parses into (HH:MM:SS): " << t2 << "\n"; diff --git a/demos/testaxe.cpp b/demos/testaxe.cpp index 1bcefe4..b514d2a 100644 --- a/demos/testaxe.cpp +++ b/demos/testaxe.cpp @@ -43,8 +43,8 @@ public: virtual int EV_Expose(XExposeEvent ev) { - DrawString(white_gc, 100, 30, "Andromeda X Windows Encapsulation"); - DrawString(white_gc, 120, 90, "Version 0.2 - July 25, 2002"); + DrawString(white_gc, 110, 30, "Andromeda X Windows Encapsulation"); + DrawString(white_gc, 110, 95, "Version 0.3 - November 05, 2002"); return 1; } @@ -240,7 +240,7 @@ int xapp::DoCommand(int code) return 1; case FILE_OPEN: - cout << "Opening " << FileDialog->PathName() << "\n"; + std::cout << "Opening " << FileDialog->PathName() << "\n"; save_item->Enable(1); return 1; diff --git a/src/amount.cpp b/src/amount.cpp index 834813f..af5e888 100644 --- a/src/amount.cpp +++ b/src/amount.cpp @@ -5,7 +5,7 @@ *********************** ** FILE NAME : amount.cpp ** SYSTEM NAME : Andromeda X-Windows Encapsulation -** VERSION NUMBER : $Revision: 1.1 $ +** VERSION NUMBER : $Revision: 1.2 $ ** ** DESCRIPTION : Financial classes : amount ** @@ -23,16 +23,19 @@ /***************************** $Log: amount.cpp,v $ - Revision 1.1 2002-07-25 08:01:26 arjen + Revision 1.2 2002-11-04 07:24:31 arjen + Use proper namespace for iostream classes + + Revision 1.1 2002/07/25 08:01:26 arjen First checkin, AXE release 0.2 *****************************/ -static const char RCSID[] = "$Id: amount.cpp,v 1.1 2002-07-25 08:01:26 arjen Exp $"; +static const char RCSID[] = "$Id: amount.cpp,v 1.2 2002-11-04 07:24:31 arjen Exp $"; #include "money.h" -istream &operator>>(istream &s, amount &a) +std::istream &operator>>(std::istream &s, amount &a) { long hundreds; char c; @@ -43,7 +46,7 @@ istream &operator>>(istream &s, amount &a) return s; } -ostream &operator<<(ostream &s, amount a) +std::ostream &operator<<(std::ostream &s, amount a) { if (a == 0) { diff --git a/src/display.h b/src/display.h index cc65b94..cd57035 100644 --- a/src/display.h +++ b/src/display.h @@ -5,7 +5,7 @@ *********************** ** FILE NAME : display.h ** SYSTEM NAME : AXE - Andromeda X-windows Encapsulation -** VERSION NUMBER : $Revision: 1.1 $ +** VERSION NUMBER : $Revision: 1.2 $ ** ** DESCRIPTION : Definition of display class ** @@ -23,17 +23,20 @@ /***************************** $Log: display.h,v $ - Revision 1.1 2002-07-25 08:01:26 arjen + Revision 1.2 2002-11-04 07:24:31 arjen + Use proper namespace for iostream classes + + Revision 1.1 2002/07/25 08:01:26 arjen First checkin, AXE release 0.2 *****************************/ -/* static const char *RCSID = "$Id: display.h,v 1.1 2002-07-25 08:01:26 arjen Exp $"; */ +/* static const char *RCSID = "$Id: display.h,v 1.2 2002-11-04 07:24:31 arjen Exp $"; */ #ifndef _DISPLAY_H #define _DISPLAY_H -#include +#include #include /* diff --git a/src/font.cpp b/src/font.cpp index 227e352..1a906f3 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -5,7 +5,7 @@ *********************** ** FILE NAME : font.cpp ** SYSTEM NAME : AXE - Andromeda X-windows Encapsulation -** VERSION NUMBER : $Revision: 1.1 $ +** VERSION NUMBER : $Revision: 1.2 $ ** ** DESCRIPTION : Implementation of font class ** @@ -23,17 +23,20 @@ /***************************** $Log: font.cpp,v $ - Revision 1.1 2002-07-25 08:01:26 arjen + Revision 1.2 2002-11-04 07:24:31 arjen + Use proper namespace for iostream classes + + Revision 1.1 2002/07/25 08:01:26 arjen First checkin, AXE release 0.2 *****************************/ -static const char *RCSID = "$Id: font.cpp,v 1.1 2002-07-25 08:01:26 arjen Exp $"; +static const char *RCSID = "$Id: font.cpp,v 1.2 2002-11-04 07:24:31 arjen Exp $"; #include #include "font.h" -int font::TextWidth(char *string, int length = 0) +int font::TextWidth(char *string, int length) { if (length == 0) { diff --git a/src/font.h b/src/font.h index 1a2510d..c4455d9 100644 --- a/src/font.h +++ b/src/font.h @@ -5,7 +5,7 @@ *********************** ** FILE NAME : font.h ** SYSTEM NAME : AXE - Andromeda X-windows Encapsulation -** VERSION NUMBER : $Revision: 1.1 $ +** VERSION NUMBER : $Revision: 1.2 $ ** ** DESCRIPTION : Definition of font class ** @@ -23,12 +23,15 @@ /***************************** $Log: font.h,v $ - Revision 1.1 2002-07-25 08:01:26 arjen + Revision 1.2 2002-11-04 07:24:31 arjen + Use proper namespace for iostream classes + + Revision 1.1 2002/07/25 08:01:26 arjen First checkin, AXE release 0.2 *****************************/ -/* static const char *RCSID = "$Id: font.h,v 1.1 2002-07-25 08:01:26 arjen Exp $"; */ +/* static const char *RCSID = "$Id: font.h,v 1.2 2002-11-04 07:24:31 arjen Exp $"; */ #include #include @@ -67,7 +70,7 @@ public: fs = XLoadQueryFont(stddpy.Dpy(), name); if (fs == NULL) { - cerr << "Warnig: can not open font " << name << "\n"; + std::cerr << "Warnig: can not open font " << name << "\n"; } } @@ -89,7 +92,7 @@ public: fs = XLoadQueryFont(stddpy.Dpy(), name); if (fs == NULL) { - cerr << "Warnig: can not open font " << name << "\n"; + std::cerr << "Warnig: can not open font " << name << "\n"; } } diff --git a/src/integer.cpp b/src/integer.cpp index 131ac74..f3d5cbe 100644 --- a/src/integer.cpp +++ b/src/integer.cpp @@ -5,7 +5,7 @@ *********************** ** FILE NAME : integer.cpp ** SYSTEM NAME : AXE - Andromeda X-windows Encapsulation -** VERSION NUMBER : $Revision: 1.1 $ +** VERSION NUMBER : $Revision: 1.2 $ ** ** DESCRIPTION : ** @@ -22,12 +22,15 @@ /***************************** $Log: integer.cpp,v $ - Revision 1.1 2002-07-25 08:01:27 arjen + Revision 1.2 2002-11-04 07:24:31 arjen + Use proper namespace for iostream classes + + Revision 1.1 2002/07/25 08:01:27 arjen First checkin, AXE release 0.2 *****************************/ -static const char *RCSID = "$Id: integer.cpp,v 1.1 2002-07-25 08:01:27 arjen Exp $"; +static const char *RCSID = "$Id: integer.cpp,v 1.2 2002-11-04 07:24:31 arjen Exp $"; #include "integer.h" @@ -53,7 +56,7 @@ integer integer::operator+(integer &a) // Add a to *this return r; } -ostream& operator<<(ostream &s, integer &i) +std::ostream& operator<<(std::ostream &s, integer &i) { int j; @@ -64,7 +67,7 @@ ostream& operator<<(ostream &s, integer &i) return s; } -istream& operator>>(istream &s, integer &i) +std::istream& operator>>(std::istream &s, integer &i) { return s; } diff --git a/src/integer.h b/src/integer.h index fa1f115..859079b 100644 --- a/src/integer.h +++ b/src/integer.h @@ -5,7 +5,7 @@ *********************** ** FILE NAME : integer.h ** SYSTEM NAME : AXE - Andromeda X-windows Encapsulation -** VERSION NUMBER : $Revision: 1.1 $ +** VERSION NUMBER : $Revision: 1.2 $ ** ** DESCRIPTION : Arbitrary length integer ** @@ -23,15 +23,18 @@ /***************************** $Log: integer.h,v $ - Revision 1.1 2002-07-25 08:01:27 arjen + Revision 1.2 2002-11-04 07:24:31 arjen + Use proper namespace for iostream classes + + Revision 1.1 2002/07/25 08:01:27 arjen First checkin, AXE release 0.2 *****************************/ -/* static const char *RCSID = "$Id: integer.h,v 1.1 2002-07-25 08:01:27 arjen Exp $"; */ +/* static const char *RCSID = "$Id: integer.h,v 1.2 2002-11-04 07:24:31 arjen Exp $"; */ -#include +#include /* * The integer class (not int !) implements an arbitrary length @@ -81,6 +84,6 @@ public: // operator<<() // operator>>() - friend ostream& operator<<(ostream&, integer&); - friend istream& operator>>(istream&, integer&); + friend std::ostream& operator<<(std::ostream&, integer&); + friend std::istream& operator>>(std::istream&, integer&); }; diff --git a/src/money.h b/src/money.h index 44f7010..9689679 100644 --- a/src/money.h +++ b/src/money.h @@ -5,7 +5,7 @@ *********************** ** FILE NAME : money.h ** SYSTEM NAME : Andromeda X-Windows Encapsulation -** VERSION NUMBER : $Revision: 1.1 $ +** VERSION NUMBER : $Revision: 1.2 $ ** ** DESCRIPTION : Financial classes ** @@ -23,18 +23,21 @@ /***************************** $Log: money.h,v $ - Revision 1.1 2002-07-25 08:01:27 arjen + Revision 1.2 2002-11-04 07:24:31 arjen + Use proper namespace for iostream classes + + Revision 1.1 2002/07/25 08:01:27 arjen First checkin, AXE release 0.2 *****************************/ -// static const char RCSID[] = "$Id: money.h,v 1.1 2002-07-25 08:01:27 arjen Exp $"; +// static const char RCSID[] = "$Id: money.h,v 1.2 2002-11-04 07:24:31 arjen Exp $"; #ifndef MONEY_H #define MONEY_H #include -#include +#include #include "String.h" /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -114,8 +117,8 @@ public: return *this; } - friend istream &operator>>(istream&, amount &); - friend ostream &operator<<(ostream&, amount); + friend std::istream &operator>>(std::istream&, amount &); + friend std::ostream &operator<<(std::ostream&, amount); }; diff --git a/src/pixmap.h b/src/pixmap.h index 08f605f..a3f84cb 100644 --- a/src/pixmap.h +++ b/src/pixmap.h @@ -5,7 +5,7 @@ *********************** ** FILE NAME : pixmap.h ** SYSTEM NAME : AXE - Andromeda X-windows Encapsulation -** VERSION NUMBER : $Revision: 1.1 $ +** VERSION NUMBER : $Revision: 1.2 $ ** ** DESCRIPTION : Definition of pixmap classes: pixmap, bitmap ** @@ -22,12 +22,15 @@ /***************************** $Log: pixmap.h,v $ - Revision 1.1 2002-07-25 08:01:27 arjen + Revision 1.2 2002-11-04 07:24:31 arjen + Use proper namespace for iostream classes + + Revision 1.1 2002/07/25 08:01:27 arjen First checkin, AXE release 0.2 *****************************/ -/* static const char *RCSID = "$Id: pixmap.h,v 1.1 2002-07-25 08:01:27 arjen Exp $"; */ +/* static const char *RCSID = "$Id: pixmap.h,v 1.2 2002-11-04 07:24:31 arjen Exp $"; */ #ifndef AXE_PIXMAP_H #define AXE_PIXMAP_H @@ -114,7 +117,7 @@ extern pixmap nopicture; error = XpmReadFileToPixmap(stddpy, stddpy.Root(), filename, &pixm, NULL, &attr); if (error != XpmSuccess) { - cerr << "Error " << error << " reading XPM file " << filename << "\n"; + std::cerr << "Error " << error << " reading XPM file " << filename << "\n"; pixm = nopicture.pixm; w = nopicture.w; h = nopicture.h; -- 2.11.0