• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeabc
 

tdeabc

  • tdeabc
timezone.cpp
1/*
2 This file is part of libtdeabc.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20
21#include <tqdatastream.h>
22
23#include "timezone.h"
24
25using namespace TDEABC;
26
27TimeZone::TimeZone() :
28 mOffset( 0 ), mValid( false )
29{
30}
31
32TimeZone::TimeZone( int offset ) :
33 mOffset( offset ), mValid( true )
34{
35}
36
37void TimeZone::setOffset( int offset )
38{
39 mOffset = offset;
40 mValid = true;
41}
42
43int TimeZone::offset() const
44{
45 return mOffset;
46}
47
48bool TimeZone::isValid() const
49{
50 return mValid;
51}
52
53bool TimeZone::operator==( const TimeZone &t ) const
54{
55 if ( !t.isValid() && !isValid() ) return true;
56 if ( !t.isValid() || !isValid() ) return false;
57 if ( t.mOffset == mOffset ) return true;
58 return false;
59}
60
61bool TimeZone::operator!=( const TimeZone &t ) const
62{
63 if ( !t.isValid() && !isValid() ) return false;
64 if ( !t.isValid() || !isValid() ) return true;
65 if ( t.mOffset != mOffset ) return true;
66 return false;
67}
68
69TQString TimeZone::asString() const
70{
71 return TQString::number( mOffset );
72}
73
74TQDataStream &TDEABC::operator<<( TQDataStream &s, const TimeZone &zone )
75{
76 return s << zone.mOffset;
77}
78
79TQDataStream &TDEABC::operator>>( TQDataStream &s, TimeZone &zone )
80{
81 s >> zone.mOffset;
82 zone.mValid = true;
83
84 return s;
85}
TDEABC::TimeZone
Time zone information.
Definition: timezone.h:36
TDEABC::TimeZone::setOffset
void setOffset(int offset)
Set time zone offset relative to UTC.
Definition: timezone.cpp:37
TDEABC::TimeZone::offset
int offset() const
Return offset in minutes relative to UTC.
Definition: timezone.cpp:43
TDEABC::TimeZone::TimeZone
TimeZone()
Construct invalid time zone.
Definition: timezone.cpp:27
TDEABC::TimeZone::asString
TQString asString() const
Return string representation of time zone offset.
Definition: timezone.cpp:69
TDEABC::TimeZone::isValid
bool isValid() const
Return, if this time zone object is valid.
Definition: timezone.cpp:48
TDEABC
static data, shared by ALL addressee objects
Definition: address.h:48

tdeabc

Skip menu "tdeabc"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeabc

Skip menu "tdeabc"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeabc by doxygen 1.9.4
This website is maintained by Timothy Pearson.