Loading...
Searching...
No Matches
fieldpos.h
Go to the documentation of this file.
// © 2016 and later: Unicode, Inc. and others.
// License & terms of use: http://www.unicode.org/copyright.html
/*
********************************************************************************
* Copyright (C) 1997-2006, International Business Machines
* Corporation and others. All Rights Reserved.
********************************************************************************
*
* File FIELDPOS.H
*
* Modification History:
*
* Date Name Description
* 02/25/97 aliu Converted from java.
* 03/17/97 clhuang Updated per Format implementation.
* 07/17/98 stephen Added default/copy ctors, and operators =, ==, !=
********************************************************************************
*/
// *****************************************************************************
// This file was generated from the java source file FieldPosition.java
// *****************************************************************************
#ifndef FIELDPOS_H
#define FIELDPOS_H
#include "unicode/utypes.h"
#if U_SHOW_CPLUSPLUS_API
#if !UCONFIG_NO_FORMATTING
#include "unicode/uobject.h"
U_NAMESPACE_BEGIN
class U_I18N_API FieldPosition : public UObject {
public:
enum { DONT_CARE = -1 };
FieldPosition()
: UObject(), fField(DONT_CARE), fBeginIndex(0), fEndIndex(0) {}
FieldPosition(int32_t field)
: UObject(), fField(field), fBeginIndex(0), fEndIndex(0) {}
FieldPosition(const FieldPosition& copy)
: UObject(copy), fField(copy.fField), fBeginIndex(copy.fBeginIndex), fEndIndex(copy.fEndIndex) {}
virtual ~FieldPosition();
FieldPosition& operator=(const FieldPosition& copy);
bool operator==(const FieldPosition& that) const;
bool operator!=(const FieldPosition& that) const;
FieldPosition *clone() const;
int32_t getField() const { return fField; }
int32_t getBeginIndex() const { return fBeginIndex; }
int32_t getEndIndex() const { return fEndIndex; }
void setField(int32_t f) { fField = f; }
void setBeginIndex(int32_t bi) { fBeginIndex = bi; }
void setEndIndex(int32_t ei) { fEndIndex = ei; }
virtual UClassID getDynamicClassID() const override;
static UClassID U_EXPORT2 getStaticClassID();
private:
int32_t fField;
int32_t fBeginIndex;
int32_t fEndIndex;
};
inline FieldPosition&
FieldPosition::operator=(const FieldPosition& copy)
{
fField = copy.fField;
fEndIndex = copy.fEndIndex;
fBeginIndex = copy.fBeginIndex;
return *this;
}
inline bool
FieldPosition::operator==(const FieldPosition& copy) const
{
return (fField == copy.fField &&
fEndIndex == copy.fEndIndex &&
fBeginIndex == copy.fBeginIndex);
}
inline bool
FieldPosition::operator!=(const FieldPosition& copy) const
{
return !operator==(copy);
}
U_NAMESPACE_END
#endif /* #if !UCONFIG_NO_FORMATTING */
#endif /* U_SHOW_CPLUSPLUS_API */
#endif // _FIELDPOS
//eof
icu::FieldPosition
FieldPosition is a simple class used by Format and its subclasses to identify fields in formatted out...
Definition fieldpos.h:110
icu::FieldPosition::~FieldPosition
virtual ~FieldPosition()
Destructor.
icu::FieldPosition::getEndIndex
int32_t getEndIndex() const
Retrieve the index of the character following the last character in the requested field.
Definition fieldpos.h:211
icu::FieldPosition::operator=
FieldPosition & operator=(const FieldPosition &copy)
Assignment operator.
Definition fieldpos.h:269
icu::FieldPosition::clone
FieldPosition * clone() const
Clone this object.
icu::FieldPosition::operator!=
bool operator!=(const FieldPosition &that) const
Equality operator.
Definition fieldpos.h:286
icu::FieldPosition::setEndIndex
void setEndIndex(int32_t ei)
Set the end index.
Definition fieldpos.h:232
icu::FieldPosition::getStaticClassID
static UClassID getStaticClassID()
ICU "poor man's RTTI", returns a UClassID for this class.
icu::FieldPosition::getField
int32_t getField() const
Retrieve the field identifier.
Definition fieldpos.h:195
icu::FieldPosition::getBeginIndex
int32_t getBeginIndex() const
Retrieve the index of the first character in the requested field.
Definition fieldpos.h:202
icu::FieldPosition::operator==
bool operator==(const FieldPosition &that) const
Equality operator.
Definition fieldpos.h:278
icu::FieldPosition::FieldPosition
FieldPosition(int32_t field)
Creates a FieldPosition object for the given field.
Definition fieldpos.h:137
icu::FieldPosition::setField
void setField(int32_t f)
Set the field.
Definition fieldpos.h:218
icu::FieldPosition::setBeginIndex
void setBeginIndex(int32_t bi)
Set the begin index.
Definition fieldpos.h:225
icu::FieldPosition::FieldPosition
FieldPosition(const FieldPosition &copy)
Copy constructor.
Definition fieldpos.h:145
icu::FieldPosition::FieldPosition
FieldPosition()
Creates a FieldPosition object with a non-specified field.
Definition fieldpos.h:123
icu::FieldPosition::getDynamicClassID
virtual UClassID getDynamicClassID() const override
ICU "poor man's RTTI", returns a UClassID for the actual class.
icu::UObject
UObject is the common ICU "boilerplate" class.
Definition uobject.h:222
icu::operator==
U_COMMON_API UBool operator==(const StringPiece &x, const StringPiece &y)
Global operator == for StringPiece.
icu::operator!=
bool operator!=(const StringPiece &x, const StringPiece &y)
Global operator != for StringPiece.
Definition stringpiece.h:346
uobject.h
C++ API: Common ICU base class UObject.
UClassID
void * UClassID
UClassID is used to identify classes without using the compiler's RTTI.
Definition uobject.h:96
utypes.h
Basic definitions for ICU, for both C and C++ APIs.
U_I18N_API
#define U_I18N_API
Set to export library symbols from inside the i18n library, and to import them from outside.
Definition utypes.h:316