1 //=============================================================================
3 * @file Storable_Base.cpp
5 * @author Bruce Trask <trask_b@ociweb.com>
6 * @author Chanaka Liyanaarachchi <chanaka@ociweb.com>
7 * @author Byron Harris <harrisb@ociweb.com>
9 //=============================================================================
11 #include "tao/Storable_Base.h"
13 #if !defined (__ACE_INLINE__)
14 #include "tao/Storable_Base.inl"
15 #endif /* __ACE_INLINE__ */
17 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
19 bool TAO::Storable_Base::use_backup_default
= false;
20 bool TAO::Storable_Base::retry_on_ebadf_default
= false;
23 TAO::Storable_Base::remove ()
25 if (this->use_backup_
)
27 this->remove_backup ();
33 TAO::Storable_Base::use_backup ()
35 return this->use_backup_
;
39 TAO::Storable_Base::state_as_string (Storable_State state
)
41 ACE_CString state_string
;
43 state_string
= "goodbit";
47 state_string
= "badbit ";
49 state_string
+= "eofbit ";
51 state_string
+= "failbit";
56 TAO::Storable_Exception::
57 Storable_Exception (const ACE_CString
& file_name
)
58 : file_name_ (file_name
)
62 TAO::Storable_Exception::
63 ~Storable_Exception ()
68 TAO::Storable_Exception::get_file_name () const
73 TAO::Storable_Read_Exception::
74 Storable_Read_Exception (Storable_Base::Storable_State state
,
75 const ACE_CString
& file_name
)
76 : Storable_Exception (file_name
)
77 , storable_state_ (state
)
81 TAO::Storable_Base::Storable_State
82 TAO::Storable_Read_Exception::get_state () const
84 return storable_state_
;
88 TAO::Storable_Write_Exception::
89 Storable_Write_Exception (Storable_Base::Storable_State state
,
90 const ACE_CString
& file_name
)
91 : Storable_Exception (file_name
)
92 , storable_state_ (state
)
96 TAO::Storable_Base::Storable_State
97 TAO::Storable_Write_Exception::get_state () const
99 return storable_state_
;
103 TAO_END_VERSIONED_NAMESPACE_DECL