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

uuidops.h

00001 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
00002  *
00003  * XPLC - Cross-Platform Lightweight Components
00004  * Copyright (C) 2000-2003, Pierre Phaneuf
00005  * Copyright (C) 2002, Net Integration Technologies, Inc.
00006  * Copyright (C) 2004, Stéphane Lajoie
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation; either version 2.1 of
00011  * the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00021  * USA
00022  *
00023  * As a special exception, you may use this file as part of a free
00024  * software library without restriction.  Specifically, if other files
00025  * instantiate templates or use macros or inline functions from this
00026  * file, or you compile this file and link it with other files to
00027  * produce an executable, this file does not by itself cause the
00028  * resulting executable to be covered by the GNU Lesser General Public
00029  * License.  This exception does not however invalidate any other
00030  * reasons why the executable file might be covered by the GNU Lesser
00031  * General Public License.
00032  */
00033 
00034 #ifndef __XPLC_UUIDOPS_H__
00035 #define __XPLC_UUIDOPS_H__
00036 
00037 #include <xplc/uuid.h>
00038 
00039 #if !defined _SYS_GUID_OPERATOR_EQ_ && !defined _NO_SYS_GUID_OPERATOR_EQ_
00040 #define _SYS_GUID_OPERATOR_EQ_
00041 
00045 inline int operator==(const UUID& uuid1, const UUID& uuid2) {
00046     return
00047       (&uuid1 == &uuid2) ||
00048       ((static_cast<const unsigned long*>(&uuid1.Data1)[0] == static_cast<const unsigned long*>(&uuid2.Data1)[0]) &&
00049        (static_cast<const unsigned long*>(&uuid1.Data1)[1] == static_cast<const unsigned long*>(&uuid2.Data1)[1]) &&
00050        (static_cast<const unsigned long*>(&uuid1.Data1)[2] == static_cast<const unsigned long*>(&uuid2.Data1)[2]) &&
00051        (static_cast<const unsigned long*>(&uuid1.Data1)[3] == static_cast<const unsigned long*>(&uuid2.Data1)[3]));
00052 }
00053 
00057 inline int operator!=(const UUID& uuid1, const UUID& uuid2) {
00058     return
00059       (&uuid1 != &uuid2) &&
00060       ((static_cast<const unsigned long*>(&uuid1.Data1)[0] != static_cast<const unsigned long*>(&uuid2.Data1)[0]) ||
00061        (static_cast<const unsigned long*>(&uuid1.Data1)[1] != static_cast<const unsigned long*>(&uuid2.Data1)[1]) ||
00062        (static_cast<const unsigned long*>(&uuid1.Data1)[2] != static_cast<const unsigned long*>(&uuid2.Data1)[2]) ||
00063        (static_cast<const unsigned long*>(&uuid1.Data1)[3] != static_cast<const unsigned long*>(&uuid2.Data1)[3]));
00064 }
00065 
00066 #endif
00067 
00076 const UUID UuidFromString(const char* str);
00077 
00086 char* UuidToString(const UUID& uuid, char* str);
00087 
00088 #endif /* __XPLC_UUIDOPS_H__ */

Generated on Sun Sep 26 04:01:25 2004 for XPLC by doxygen1.2.18