diff options
Diffstat (limited to 'TAO/tao/Storable_Base.cpp')
-rw-r--r-- | TAO/tao/Storable_Base.cpp | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/TAO/tao/Storable_Base.cpp b/TAO/tao/Storable_Base.cpp new file mode 100644 index 00000000000..dc588dd8db8 --- /dev/null +++ b/TAO/tao/Storable_Base.cpp @@ -0,0 +1,97 @@ +//============================================================================= +/** + * @file Storable_Base.cpp + * + * $Id$ + * + * @author Bruce Trask <trask_b@ociweb.com> + * @author Chanaka Liyanaarachchi <chanaka@ociweb.com> + * @author Byron Harris <harrisb@ociweb.com> + */ +//============================================================================= + +#include "tao/Storable_Base.h" + +#if !defined (__ACE_INLINE__) +#include "tao/Storable_Base.inl" +#endif /* __ACE_INLINE__ */ + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +bool TAO::Storable_Base::use_backup_default = false; + +void +TAO::Storable_Base::remove (void) +{ + if (this->use_backup_) + { + this->remove_backup (); + } + this->do_remove (); +} + +bool +TAO::Storable_Base::use_backup () +{ + return this->use_backup_; +} + +ACE_CString +TAO::Storable_Base::state_as_string (Storable_State state) +{ + ACE_CString state_string; + if (state == goodbit) + state_string = "goodbit"; + else + { + if (state & badbit) + state_string = "badbit "; + if (state & eofbit) + state_string += "eofbit "; + if (state & failbit) + state_string += "failbit"; + } + return state_string; +} + +TAO::Storable_Exception:: +Storable_Exception (Storable_Base::Storable_State state, + const ACE_CString & file_name) + : storable_state_ (state) + , file_name_ (file_name) +{ +} + +TAO::Storable_Exception:: +~Storable_Exception () +{ +} + +TAO::Storable_Base::Storable_State +TAO::Storable_Exception::get_state () const +{ + return storable_state_; +} + +const ACE_CString & +TAO::Storable_Exception::get_file_name () const +{ + return file_name_; +} + +TAO::Storable_Read_Exception:: +Storable_Read_Exception (Storable_Base::Storable_State state, + const ACE_CString & file_name) + : Storable_Exception (state, file_name) +{ +} + +TAO::Storable_Write_Exception:: +Storable_Write_Exception (Storable_Base::Storable_State state, + const ACE_CString & file_name) + : Storable_Exception (state, file_name) +{ +} + + +TAO_END_VERSIONED_NAMESPACE_DECL |