1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: timestamp.hxx,v $
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
34 #include <tools/string.hxx>
38 #include <tools/stream.hxx>
42 #include <tools/datetime.hxx>
47 //______________________________________________________________________________________________________________________________
49 //______________________________________________________________________________________________________________________________
51 #define TIMESTAMP_MAXLENGTH 31 /// Max. length of valid timestamp in stream.
53 //______________________________________________________________________________________________________________________________
55 //______________________________________________________________________________________________________________________________
59 //--------------------------------------------------------------------------------
61 //--------------------------------------------------------------------------------
64 //--------------------------------------------------------------------------------
65 // construct / destruct
66 //--------------------------------------------------------------------------------
69 TimeStamp ( const String
& rName
) ;
70 TimeStamp ( const DateTime
& rDateTime
) ;
71 TimeStamp ( const String
& rName
, const DateTime
& rDateTime
) ;
73 //--------------------------------------------------------------------------------
75 //--------------------------------------------------------------------------------
77 const TimeStamp
& operator= ( const TimeStamp
& rCopy
) ;
78 BOOL
operator== ( const TimeStamp
& rCompare
) const ;
79 int operator!= ( const TimeStamp
& rCompare
) const ;
81 //--------------------------------------------------------------------------------
83 //--------------------------------------------------------------------------------
85 BOOL
IsValid ( ) const ;
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 //--------------------------------------------------------------------------------
96 //--------------------------------------------------------------------------------
99 //--------------------------------------------------------------------------------
101 //--------------------------------------------------------------------------------
104 void impl_adjustName ( String
& rName
) ;
106 //--------------------------------------------------------------------------------
108 //--------------------------------------------------------------------------------
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 ;
120 //--------------------------------------------------------------------------------
122 //--------------------------------------------------------------------------------
125 String m_sModifiedByName
; /// Name of stamp
126 DateTime m_aModifiedDateTime
; /// Time and date of stamp
130 #endif // _TIMESTAMP_HXX