00001 /* 00002 FALCON - The Falcon Programming Language. 00003 FILE: stringwithid.h 00004 00005 An extenson of the Falcon::String that saves also the module string ID. 00006 ------------------------------------------------------------------- 00007 Author: Giancarlo Niccolai 00008 Begin: gio lug 21 2005 00009 00010 ------------------------------------------------------------------- 00011 (C) Copyright 2004: the FALCON developers (see list in AUTHORS file) 00012 00013 See LICENSE file for licensing details. 00014 */ 00015 00020 #ifndef flc_stringwithid_H 00021 #define flc_stringwithid_H 00022 00023 #include <falcon/string.h> 00024 00025 namespace Falcon 00026 { 00027 00032 class StringWithID: public String 00033 { 00034 int32 m_id; 00035 public: 00037 StringWithID( const char *data ): 00038 String( data ) 00039 {} 00040 00041 StringWithID( const char *data, uint32 len ): 00042 String( data, len ) 00043 {} 00044 00045 StringWithID(): 00046 String() 00047 {} 00048 00049 StringWithID( byte *buffer, uint32 size, uint32 allocated ): 00050 String( buffer, size, allocated ) 00051 {} 00052 00053 explicit StringWithID( uint32 prealloc ): 00054 String( prealloc ) 00055 {} 00056 00057 StringWithId( const StringWithID &other ): 00058 String( other ) 00059 { 00060 m_id = other.m_id; 00061 } 00062 00063 int32 id() const { return m_id; } 00064 void id( int32 val ) { m_id = val; } 00065 }; 00066 00067 } 00068 00069 #endif 00070 00071 /* end of stringwithid.h */