From 7ae633f8a997997524cded2d205d14eeb5f08051 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Thu, 2 Oct 2008 13:13:03 +0000 Subject: Updated on my laptop and discovered that the new, more pedantic gcc had a problem with a missing include. Also, if you get errors about conflicts and things being declared twice, then "rm src/exceptions.o" it shouldn't be sneaking in there still, but it may be. then do a full "build -c all" and build. Oh, also found some solid gold taf code that never got included, but is very much needed. Remembering to commit would be useful... --- src/file.cpp | 7 +++++++ src/file.h | 7 +------ src/tafnode.cpp | 10 ++++++++++ src/tafnode.h | 2 ++ 4 files changed, 20 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/file.cpp b/src/file.cpp index 5049bbb..417c445 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -11,6 +11,7 @@ #include #include #include +#include // for mkstemp namespace Bu { subExceptionDef( FileException ) } @@ -150,6 +151,12 @@ void Bu::File::setBlocking( bool bBlocking ) } #ifndef WIN32 +Bu::File Bu::File::tempFile( Bu::FString &sName, int /*iFlags*/ ) +{ + int afh_d = mkstemp( sName.getStr() ); + + return Bu::File( afh_d ); +} void Bu::File::truncate( long nSize ) { ftruncate( fd, nSize ); diff --git a/src/file.h b/src/file.h index 40419b0..a50d53c 100644 --- a/src/file.h +++ b/src/file.h @@ -76,12 +76,7 @@ namespace Bu *@returns (Bu::File) A file object representing your temp file. */ #ifndef WIN32 - inline static Bu::File tempFile( Bu::FString &sName, int /*iFlags*/ ) - { - int afh_d = mkstemp( sName.getStr() ); - - return Bu::File( afh_d ); - } + static Bu::File tempFile( Bu::FString &sName, int iFlags ); /** * Set the size of the file to (nSize). You can either grow or shrink diff --git a/src/tafnode.cpp b/src/tafnode.cpp index 128355a..829a8e1 100644 --- a/src/tafnode.cpp +++ b/src/tafnode.cpp @@ -104,6 +104,11 @@ Bu::TafProperty *Bu::TafGroup::addProperty( return addChild( new TafProperty( sName, sValue ) ); } +bool Bu::TafGroup::hasChild( const Bu::FString &sName ) const +{ + return hChildren.has( sName ); +} + const Bu::TafGroup::GroupList &Bu::TafGroup::getChildren( const Bu::FString &sName ) const { return hChildren.get( sName ); @@ -119,6 +124,11 @@ const Bu::TafGroup *Bu::TafGroup::getChild( const Bu::FString &sName ) const return hChildren.get( sName ).first(); } +bool Bu::TafGroup::hasProperty( const Bu::FString &sName ) const +{ + return hProp.has( sName ); +} + const Bu::TafGroup::PropList &Bu::TafGroup::getProperties( const Bu::FString &sName ) const { return hProp.get( sName ); diff --git a/src/tafnode.h b/src/tafnode.h index 526ef68..f6d2ea9 100644 --- a/src/tafnode.h +++ b/src/tafnode.h @@ -62,10 +62,12 @@ namespace Bu const Bu::FString &getName() const; void setName( const Bu::FString &sName ); + bool hasProperty( const Bu::FString &sName ) const; const Bu::FString &getProperty( const Bu::FString &sName ) const; const Bu::FString &getProperty( const Bu::FString &sName, const Bu::FString &sDef ) const; const PropList &getProperties( const Bu::FString &sName ) const; + bool hasChild( const Bu::FString &sName ) const; const TafGroup *getChild( const Bu::FString &sName ) const; const GroupList &getChildren( const Bu::FString &sName ) const; TafNode *addChild( TafNode *pNode ); -- cgit v1.2.3