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

xybool.cpp

Go to the documentation of this file.
00001 /*****************************************************************************/
00002 /* Módulo: xybool.cpp                                                        */
00003 /* Autor: Marcelo Jaccoud Amaral                                             */
00004 /* Data: 24 abr 96                                                           */
00005 /* Comentário:                                                               */
00006 /*    Implementação de métodos da classe bool, para compiladores que ainda   */
00007 /* não têm o tipo básico bool (ANSI).                                        */
00008 /*****************************************************************************/
00009 
00010 #ifndef __BOOL_H
00011 
00012 #include "xybool.h"
00013 
00014 #include <iostream.h>
00015 
00016 const char* xy_id_xybool_cpp="$Id: xybool.cpp,v 1.5 1998/12/01 15:56:42 camilo Exp $";
00017                                                                 
00018 // Operadores globais
00019 
00020 // Extrai o booleano b no fluxo i. A representação deve ser '1' (true)
00021 // ou '0' (false), já que o inteiro correspondente é armazenado
00022 istream& operator >> (istream &i, bool &b)
00023 {
00024    i >> b._b;
00025    return i;
00026 }
00027 
00028 // Insere o booleano b no fluxo o. Se bool == true, insere '1', senão
00029 // insere '0'(false)
00030 ostream& operator << (ostream &o, const bool &b)
00031 {
00032    o << b._b;
00033    return o;
00034 }
00035 
00036 #endif

XY
Tecgraf / PUC-Rio - Computer Graphics Technology Group