rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Data Access Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IliInputMask Class Reference

Input mask class. More...

#include <ilviews/dataccess/inpmask.h>

List of all members.

Public Member Functions

 IliInputMask (const IliInputMask &msk)
 Initializes an instance of IliInputMask with another mask.
 IliInputMask (const char *definition)
 Initializes a mask according to one definition.
 IliInputMask ()
 Initializes a default mask.
IlBoolean format (IliString &dest, const IliValue &src, IlBoolean forEdit) const
 Formats a value.
void formatForClipboard (IliString &dest, const char *src, IlInt startPos) const
 Formats a character string for the clipboard.
const char * getDefinition () const
 Returns the mask definition.
IlBoolean isNull () const
 Returns IlTrue if the mask definition is null.
IliInputMaskoperator= (const IliInputMask &msk)
 Copies a mask.
int operator== (const IliInputMask &) const
 Compares two masks.
void read (IL_STDPREF istream &input)
 Reads the mask from an input stream.
void setDefinition (const char *definition)
 Sets the mask definition.
IlBoolean unFormat (IliString &dest, const char *src) const
 Unformats a character string.
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.

Static Public Member Functions

static void AddAlias (const char *aliasName, const char *definition)
 Defines a new alias.
static const char * GetAliasDefinition (const char *aliasName)
 Returns the alias definition.
static const char * GetAliasDefinition (IlInt aliasIndex)
 Returns the alias definition.
static IlInt GetAliasesCount ()
 Returns the count of the mask aliases.
static IlInt GetAliasIndex (const char *aliasName)
 Returns the alias index.
static const char * GetAliasName (IlInt aliasIndex)
 Returns the name of one alias.
static IliInputMaskGetDefaultMask ()
 Returns a constant reference to the default mask.
static wchar_t GetPlaceHolderChar ()
 Returns the character used to represent the missing character during the edit mode.
static void RemoveAlias (IlInt aliasIndex)
 Removes an alias.
static void SetAliasDefinition (IlInt aliasIndex, const char *definition)
 Sets alias definition.
static void SetAliasName (IlInt aliasIndex, const char *name)
 Sets alias name.
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:
definition The definition.
IliInputMask::IliInputMask ( const IliInputMask msk  ) 

Initializes an instance of IliInputMask with another mask.

Parameters:
msk The origin mask.

Member Function Documentation

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

Defines a new alias.

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

Formats a value.

Parameters:
dest The formatted string.
src The value.
forEdit If 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:
dest The formatted string.
src The string.
startPos The position of the first character to format (position begins at 0).
static const char* IliInputMask::GetAliasDefinition ( const char *  aliasName  )  [static]

Returns the alias definition.

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

Returns the alias definition.

Parameters:
aliasIndex The alias index.
Returns:
The definition for the alias at the aliasIndex position.
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:
aliasName The 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:
aliasIndex The 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:
msk The 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:
input The input stream.
static void IliInputMask::RemoveAlias ( IlInt  aliasIndex  )  [static]

Removes an alias.

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

Sets alias definition.

Parameters:
aliasIndex The alias index.
definition The alias definition.
static void IliInputMask::SetAliasName ( IlInt  aliasIndex,
const char *  name 
) [static]

Sets alias name.

Parameters:
aliasIndex The alias index.
name The alias name.
void IliInputMask::setDefinition ( const char *  definition  ) 

Sets the mask definition.

Parameters:
definition The 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:
name The placeholder name.
value The new value.
IlBoolean IliInputMask::unFormat ( IliString dest,
const char *  src 
) const

Unformats a character string.

Parameters:
dest The unformatted string.
src The 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:
output The output stream.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends

© Copyright 2012, 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.