rwlogo

Rogue Wave Views
Data Access Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator
List of all members | Public Member Functions | Static Public Member Functions
IliInputMask Class Reference

Input mask class. More...

#include <ilviews/dataccess/inpmask.h>

Public Member Functions

 IliInputMask ()
 Initializes a default mask.
 
 IliInputMask (const char *definition)
 Initializes a mask according to one definition. More...
 
 IliInputMask (const IliInputMask &msk)
 Initializes an instance of IliInputMask with another mask. More...
 
IlBoolean format (IliString &dest, const IliValue &src, IlBoolean forEdit) const
 Formats a value. More...
 
void formatForClipboard (IliString &dest, const char *src, IlInt startPos) const
 Formats a character string for the clipboard. More...
 
const char * getDefinition () const
 Returns the mask definition. More...
 
IlBoolean isNull () const
 Returns IlTrue if the mask definition is null. More...
 
IliInputMaskoperator= (const IliInputMask &msk)
 Copies a mask. More...
 
int operator== (const IliInputMask &) const
 Compares two masks. More...
 
void read (IL_STDPREF istream &input)
 Reads the mask from an input stream. More...
 
void setDefinition (const char *definition)
 Sets the mask definition. More...
 
IlBoolean unFormat (IliString &dest, const char *src) const
 Unformats a character string. More...
 
void write (IL_STDPREF ostream &output) const
 Writes the mask definition to an output stream in such a way that it may be read back by the read member function. More...
 

Static Public Member Functions

static void AddAlias (const char *aliasName, const char *definition)
 Defines a new alias. More...
 
static const char * GetAliasDefinition (IlInt aliasIndex)
 Returns the alias definition. More...
 
static const char * GetAliasDefinition (const char *aliasName)
 Returns the alias definition. More...
 
static IlInt GetAliasesCount ()
 Returns the count of the mask aliases. More...
 
static IlInt GetAliasIndex (const char *aliasName)
 Returns the alias index. More...
 
static const char * GetAliasName (IlInt aliasIndex)
 Returns the name of one alias. More...
 
static IliInputMaskGetDefaultMask ()
 Returns a constant reference to the default mask. More...
 
static wchar_t GetPlaceHolderChar ()
 Returns the character used to represent the missing character during the edit mode. More...
 
static void RemoveAlias (IlInt aliasIndex)
 Removes an alias. More...
 
static void SetAliasDefinition (IlInt aliasIndex, const char *definition)
 Sets alias definition. More...
 
static void SetAliasName (IlInt aliasIndex, const char *name)
 Sets alias name. More...
 
static void SetPlaceHolderValue (IliPlaceHolderName name, wchar_t value)
 

Detailed Description

Input mask class.

Library: dataccess

This class defines the mask that is used to enter data into an IliEntryField. The mask is defined by a character string (see specifications syntax). The mask has two modes:

See Also
IliInputMaskIpl, IliPlaceHolderName

Constructor & Destructor Documentation

IliInputMask::IliInputMask ( const char *  definition)

Initializes a mask according to one definition.

Parameters
definitionThe definition.
IliInputMask::IliInputMask ( const IliInputMask msk)

Initializes an instance of IliInputMask with another mask.

Parameters
mskThe origin mask.

Member Function Documentation

static void IliInputMask::AddAlias ( const char *  aliasName,
const char *  definition 
)
static

Defines a new alias.

Parameters
aliasNameThe alias name.
definitionThe alias definition.
IlBoolean IliInputMask::format ( IliString dest,
const IliValue src,
IlBoolean  forEdit 
) const

Formats a value.

Parameters
destThe formatted string.
srcThe value.
forEditIf IlTrue, the missing characters are replaced by the character returned by the function GetPlaceHolderChar.
Returns
IlTrue if it is successful.
void IliInputMask::formatForClipboard ( IliString dest,
const char *  src,
IlInt  startPos 
) const

Formats a character string for the clipboard.

All mandatory missing characters are replaced by the default character.

Parameters
destThe formatted string.
srcThe string.
startPosThe position of the first character to format (position begins at 0).
static const char* IliInputMask::GetAliasDefinition ( IlInt  aliasIndex)
static

Returns the alias definition.

Parameters
aliasIndexThe alias index.
Returns
The definition for the alias at the aliasIndex position.
static const char* IliInputMask::GetAliasDefinition ( const char *  aliasName)
static

Returns the alias definition.

Parameters
aliasNameThe alias name.
Returns
The definition of the alias given by the aliasName parameter. Returns -1 if no such alias is found.
static IlInt IliInputMask::GetAliasesCount ( )
static

Returns the count of the mask aliases.

Returns
The count.
static IlInt IliInputMask::GetAliasIndex ( const char *  aliasName)
static

Returns the alias index.

Parameters
aliasNameThe alias name.
Returns
The position of the alias given by the aliasName parameter. Returns -1 if no such alias is found.
static const char* IliInputMask::GetAliasName ( IlInt  aliasIndex)
static

Returns the name of one alias.

Parameters
aliasIndexThe alias index.
Returns
The name.
static IliInputMask& IliInputMask::GetDefaultMask ( )
static

Returns a constant reference to the default mask.

Returns
The default mask.
const char* IliInputMask::getDefinition ( ) const

Returns the mask definition.

Returns
The definition.
static wchar_t IliInputMask::GetPlaceHolderChar ( )
static

Returns the character used to represent the missing character during the edit mode.

Returns
The character.
IlBoolean IliInputMask::isNull ( ) const

Returns IlTrue if the mask definition is null.

Returns
IlTrue if the mask definition is null.
IliInputMask& IliInputMask::operator= ( const IliInputMask msk)

Copies a mask.

Parameters
mskThe mask which is copied.
int IliInputMask::operator== ( const IliInputMask ) const

Compares two masks.

Returns
1 if the masks are equal.
void IliInputMask::read ( IL_STDPREF istream &  input)

Reads the mask from an input stream.

Parameters
inputThe input stream.
static void IliInputMask::RemoveAlias ( IlInt  aliasIndex)
static

Removes an alias.

Parameters
aliasIndexThe alias index.
static void IliInputMask::SetAliasDefinition ( IlInt  aliasIndex,
const char *  definition 
)
static

Sets alias definition.

Parameters
aliasIndexThe alias index.
definitionThe alias definition.
static void IliInputMask::SetAliasName ( IlInt  aliasIndex,
const char *  name 
)
static

Sets alias name.

Parameters
aliasIndexThe alias index.
nameThe alias name.
void IliInputMask::setDefinition ( const char *  definition)

Sets the mask definition.

Parameters
definitionThe definition.
static void IliInputMask::SetPlaceHolderValue ( IliPlaceHolderName  name,
wchar_t  value 
)
static

Changes a place holder which is used to define a mask.

You can use this function to change the value of the placeholders. For example, you decide that the colon is the date separator for the mask definition. But, in this case, you must change the placeholder for time separator because two placeholders can not have the same value, Except, for the placeholders about set of characters. Note: If you change the value for a placeholder, the correct working of the default mask is not guaranteed.

Parameters
nameThe placeholder name.
valueThe new value.
IlBoolean IliInputMask::unFormat ( IliString dest,
const char *  src 
) const

Unformats a character string.

Parameters
destThe unformatted string.
srcThe string.
Returns
IlTrue if it is successful.
void IliInputMask::write ( IL_STDPREF ostream &  output) const

Writes the mask definition to an output stream in such a way that it may be read back by the read member function.

Parameters
outputThe output stream.

© Copyright 2015, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.