secureswitools/swisistools/source/sisxlibrary/sistime.h
changeset 0 ba25891c3a9e
child 26 04d4a7bbc3e0
equal deleted inserted replaced
-1:000000000000 0:ba25891c3a9e
       
     1 /*
       
     2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 * Note: This file may contain code to generate corrupt files for test purposes.
       
    16 * Such code is excluded from production builds by use of compiler defines;
       
    17 * it is recommended that such code should be removed if this code is ever published publicly.
       
    18 * As specified in SGL.GT0188.251
       
    19 *
       
    20 */
       
    21 
       
    22 
       
    23 /**
       
    24  @file 
       
    25  @publishedPartner
       
    26  @released
       
    27 */
       
    28 
       
    29 #ifndef __SISTIME_H__
       
    30 #define __SISTIME_H__
       
    31 
       
    32 
       
    33 #include "structure.h"
       
    34 #include "numeric.h"
       
    35 
       
    36 class CSISTime : public CStructure <CSISFieldRoot::ESISTime>
       
    37 	{
       
    38 public:
       
    39 	/**
       
    40 	 * Default constructor.
       
    41 	 */
       
    42 	CSISTime ();
       
    43 	/**
       
    44 	 * Copy constructor.
       
    45 	 */
       
    46 	CSISTime (const CSISTime& aInitialiser);
       
    47 
       
    48 	/**
       
    49 	 * Verify the instance of class. In case of any invalid
       
    50 	 * data it will throw an exception.
       
    51 	 * @param aLanguages Language count.
       
    52 	 */
       
    53 	virtual void Verify (const TUint32 aLanguages) const;
       
    54 	/**
       
    55 	 * Class name
       
    56 	 */
       
    57 	virtual std::string Name () const;
       
    58 #ifdef GENERATE_ERRORS
       
    59 	virtual void CreateDefects ();
       
    60 #endif // GENERATE_ERRORS
       
    61 
       
    62 	/**
       
    63 	 * Set a new time.
       
    64 	 * @param aHours New value for hours.
       
    65 	 * @param aMinutes New value for minutes.
       
    66 	 * @param aSeconds New value for seconds. 
       
    67 	 */
       
    68 	void Set (const TUint8 aHours, const TUint8 aMinutes, const TUint8 aSeconds);
       
    69 	/**
       
    70 	 * Adds the write the package details into the stream.
       
    71 	 * @param aStream - Stream in which the package entries need to be written.
       
    72 	 * @param aVerbose - If this option is set then detail description of pkg
       
    73 	 * 			will be written into the stream.
       
    74 	 */
       
    75 	void AddPackageEntry(std::wostream& aStream, bool aVerbose) const;
       
    76 	/**
       
    77 	 * Get value for Hours
       
    78 	 */
       
    79 	inline TUint8 Hours() const;
       
    80 	/**
       
    81 	 * Get value for Minutes
       
    82 	 */
       
    83 	inline TUint8 Minutes() const;
       
    84 	/**
       
    85 	 * Get value for Seconds
       
    86 	 */
       
    87 	inline TUint8 Seconds() const;
       
    88 
       
    89 private:
       
    90 	void InsertMembers ();
       
    91 
       
    92 private:
       
    93 	CSISUInt8 iHours;
       
    94 	CSISUInt8 iMinutes;
       
    95 	CSISUInt8 iSeconds;
       
    96 	};
       
    97 
       
    98 
       
    99 inline CSISTime::CSISTime ()
       
   100 	{
       
   101 	InsertMembers ();
       
   102 	}
       
   103 
       
   104 
       
   105 inline std::string CSISTime::Name () const
       
   106 	{
       
   107 	return "Time";
       
   108 	}
       
   109 
       
   110 inline TUint8 CSISTime::Hours() const
       
   111 	{
       
   112 	return iHours;
       
   113 	}
       
   114 
       
   115 inline TUint8 CSISTime::Minutes() const
       
   116 	{
       
   117 	return iMinutes;
       
   118 	}
       
   119 
       
   120 inline TUint8 CSISTime::Seconds() const
       
   121 	{
       
   122 	return iSeconds;
       
   123 	}
       
   124 
       
   125 
       
   126 
       
   127 
       
   128 #endif // __SISTIME_H__
       
   129