StandardUnit Class Reference

A class utility defining standard units for use as you please, although corrupting them may cause some annoyance. Notes: Contains only static members. See Also: class UnitGroup, class ScaleUnit. More...

#include <scunit.h>

List of all members.

Static Public Member Functions

static BOOL Init ()
 Initializes the Standard ScaleUnits & UnitGroups.
static BOOL DeInit ()
 Returns the StandardUnit class to a stable state as it was prior to Init() being called. Actually does nothing.

Static Public Attributes

static NullQualifier TheNullQualifier
static ScaleUnit UnitPercent
static ScaleUnit UnitDecimalD
static ScaleUnit UnitDecimald
static ScaleUnit UnitDegree
static UnitGroup PercentGroup
static UnitGroup AngleGroup

Private Member Functions

 CC_DECLARE_MEMDUMP (StandardUnit)


Detailed Description

A class utility defining standard units for use as you please, although corrupting them may cause some annoyance. Notes: Contains only static members. See Also: class UnitGroup, class ScaleUnit.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/05/96

Definition at line 380 of file scunit.h.


Member Function Documentation

StandardUnit::CC_DECLARE_MEMDUMP StandardUnit   )  [private]
 

BOOL StandardUnit::DeInit void   )  [static]
 

Returns the StandardUnit class to a stable state as it was prior to Init() being called. Actually does nothing.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/05/96
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
TRUE if deinitialization successful, FALSE otherwise

Errors: - Scope: public

See also:
Init(), class StandardUnit

Definition at line 1764 of file scunit.cpp.

01765 {
01766     UnitDecimalD.SetQualifier(StandardUnit::TheNullQualifier);
01767     UnitDecimald.SetQualifier(StandardUnit::TheNullQualifier);
01768     UnitPercent.SetQualifier(StandardUnit::TheNullQualifier);
01769     return TRUE;
01770 }

BOOL StandardUnit::Init void   )  [static]
 

Initializes the Standard ScaleUnits & UnitGroups.

/

Globals for StandardUnit class... Sets ScaleUnit StandardUnit::UnitPercent(100.0, 1); ScaleUnit StandardUnit::UnitDecimalD(255.0, 0); ScaleUnit StandardUnit::UnitDecimald(255.0, 0); ScaleUnit StandardUnit::UnitDegree(360.0, 1);

UnitGroup StandardUnit::PercentGroup; UnitGroup StandardUnit::AngleGroup;

NullQualifier StandardUnit::TheNullQualifier; // the Qualifier with no token

/*!

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
02/05/96
Returns:
TRUE if initialization successful, FALSE otherwise

Errors: ERROR2's if failed to initialize properly Scope: public

See also:
DeInit(), class StandardUnit

Definition at line 1715 of file scunit.cpp.

01716 {
01717     String_32 qualifierToken;
01718 
01719     ERROR2IF(!qualifierToken.Load(_R(IDS_PARSE_PERCENT)), FALSE, "Could not get percent token");
01720     ERROR2IF(!UnitPercent.SetQualifier(qualifierToken, Qualifier::IS_SHOWN), FALSE, "Could not set qualifier");
01721 
01722     ERROR2IF(!qualifierToken.Load(_R(IDS_PARSE_LARGED)), FALSE, "Could not get decimal token");
01723     ERROR2IF(!UnitDecimalD.SetQualifier(qualifierToken, Qualifier::IS_NOTSHOWN), FALSE, "Could not set qualifier");
01724 
01725     ERROR2IF(!qualifierToken.Load(_R(IDS_PARSE_SMALLD)), FALSE, "Could not get decimal token");
01726     ERROR2IF(!UnitDecimald.SetQualifier(qualifierToken, Qualifier::IS_NOTSHOWN), FALSE, "Could not set qualifier");
01727 
01728     ERROR2IF(!PercentGroup.AddUnit(&UnitPercent), FALSE, "could not add unit");
01729     ERROR2IF(!PercentGroup.AddUnit(&UnitDecimald), FALSE, "could not add unit");
01730     ERROR2IF(!PercentGroup.AddUnit(&UnitDecimalD), FALSE, "could not add unit");
01731 
01732     ERROR2IF(!UnitDegree.SetQualifier(StandardUnit::TheNullQualifier), FALSE, "Could not set qualifier");
01733     ERROR2IF(!AngleGroup.AddUnit(&UnitDegree), FALSE, "could not add unit");
01734 
01735 #ifdef _DEBUG
01736     ERROR2IF(!qualifierToken.Load(_R(IDS_PARSE_PERCENT)), FALSE, "Could not get percent token");
01737     ScaleUnit testUnit(100.0, 1);
01738     testUnit.SetQualifier(qualifierToken, Qualifier::IS_NOTSHOWN);
01739     double num = 50.0;
01740     testUnit.StringFromScale(num, &qualifierToken, 5);
01741 #endif
01742 
01743     return TRUE;
01744 }


Member Data Documentation

UnitGroup StandardUnit::AngleGroup [static]
 

Definition at line 396 of file scunit.h.

UnitGroup StandardUnit::PercentGroup [static]
 

Definition at line 395 of file scunit.h.

NullQualifier StandardUnit::TheNullQualifier [static]
 

Definition at line 388 of file scunit.h.

ScaleUnit StandardUnit::UnitDecimald [static]
 

Definition at line 392 of file scunit.h.

ScaleUnit StandardUnit::UnitDecimalD [static]
 

Definition at line 391 of file scunit.h.

ScaleUnit StandardUnit::UnitDegree [static]
 

Definition at line 393 of file scunit.h.

ScaleUnit StandardUnit::UnitPercent [static]
 

Definition at line 390 of file scunit.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:01:24 2007 for Camelot by  doxygen 1.4.4