sync master with lastest vba changes
[ooovba.git] / binfilter / inc / bf_sfx2 / timestamp.hxx
bloba0fadc09ca79c937645e1d5fccbef4e4e0d123e4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: timestamp.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _SFX2_TIMESTAMP_HXX
31 #define _SFX2_TIMESTAMP_HXX
33 #ifndef _STRING_HXX
34 #include <tools/string.hxx>
35 #endif
37 #ifndef _STREAM_HXX
38 #include <tools/stream.hxx>
39 #endif
41 #ifndef _DATETIME_HXX
42 #include <tools/datetime.hxx>
43 #endif
45 namespace binfilter {
47 //______________________________________________________________________________________________________________________________
48 // defines
49 //______________________________________________________________________________________________________________________________
51 #define TIMESTAMP_MAXLENGTH 31 /// Max. length of valid timestamp in stream.
53 //______________________________________________________________________________________________________________________________
54 // classes, structs
55 //______________________________________________________________________________________________________________________________
57 class TimeStamp
59 //--------------------------------------------------------------------------------
60 // public method
61 //--------------------------------------------------------------------------------
62 public:
64 //--------------------------------------------------------------------------------
65 // construct / destruct
66 //--------------------------------------------------------------------------------
68 TimeStamp ( ) ;
69 TimeStamp ( const String& rName ) ;
70 TimeStamp ( const DateTime& rDateTime ) ;
71 TimeStamp ( const String& rName, const DateTime& rDateTime ) ;
73 //--------------------------------------------------------------------------------
74 // operator methods
75 //--------------------------------------------------------------------------------
77 const TimeStamp& operator= ( const TimeStamp& rCopy ) ;
78 BOOL operator== ( const TimeStamp& rCompare ) const ;
79 int operator!= ( const TimeStamp& rCompare ) const ;
81 //--------------------------------------------------------------------------------
82 // other methods
83 //--------------------------------------------------------------------------------
85 BOOL IsValid ( ) const ;
86 void SetInvalid();
87 BOOL Load ( SvStream& rStream ) ;
88 BOOL Save ( SvStream& rStream ) const ;
89 void SetName ( const String& rName ) ;
90 void SetTime ( const DateTime& rDateTime ) ;
91 const String& GetName ( ) const ;
92 const DateTime& GetTime ( ) const ;
94 //--------------------------------------------------------------------------------
95 // protected methods
96 //--------------------------------------------------------------------------------
97 protected:
99 //--------------------------------------------------------------------------------
100 // private methods
101 //--------------------------------------------------------------------------------
102 private:
104 void impl_adjustName ( String& rName ) ;
106 //--------------------------------------------------------------------------------
107 // debug methods
108 //--------------------------------------------------------------------------------
110 #ifdef DBG_UTIL
112 BOOL impl_debug_checkParameter ( const String& rString ) const ;
113 BOOL impl_debug_checkParameter ( const String& rString, const DateTime& rDateTime ) const ;
114 BOOL impl_debug_checkParameter ( const TimeStamp& rTimeStamp ) const ;
115 BOOL impl_debug_checkParameter ( SvStream& rSvStream ) const ;
116 BOOL impl_debug_checkParameter ( const DateTime& rDateTime ) const ;
118 #endif // DBG_UTIL
120 //--------------------------------------------------------------------------------
121 // private variables
122 //--------------------------------------------------------------------------------
123 private:
125 String m_sModifiedByName ; /// Name of stamp
126 DateTime m_aModifiedDateTime ; /// Time and date of stamp
130 #endif // _TIMESTAMP_HXX