intl/icu/source/i18n/fphdlimp.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /*
     2 *******************************************************************************
     3 * Copyright (C) 2009-2010, International Business Machines Corporation and    *
     4 * others. All Rights Reserved.                                                *
     5 *******************************************************************************
     6 */
     8 #ifndef FPHDLIMP_H
     9 #define FPHDLIMP_H
    11 #if !UCONFIG_NO_FORMATTING
    13 #include "unicode/utypes.h"
    14 #include "unicode/fieldpos.h"
    15 #include "unicode/fpositer.h"
    17 U_NAMESPACE_BEGIN
    19 // utility FieldPositionHandler
    20 // base class, null implementation
    22 class FieldPositionHandler: public UMemory {
    23  public:
    24   virtual ~FieldPositionHandler();
    25   virtual void addAttribute(int32_t id, int32_t start, int32_t limit);
    26   virtual void shiftLast(int32_t delta);
    27   virtual UBool isRecording(void);
    28 };
    31 // utility subclass FieldPositionOnlyHandler
    33 class FieldPositionOnlyHandler : public FieldPositionHandler {
    34   FieldPosition& pos;
    36  public:
    37   FieldPositionOnlyHandler(FieldPosition& pos);
    38   virtual ~FieldPositionOnlyHandler();
    40   virtual void addAttribute(int32_t id, int32_t start, int32_t limit);
    41   virtual void shiftLast(int32_t delta);
    42   virtual UBool isRecording(void);
    43 };
    46 // utility subclass FieldPositionIteratorHandler
    48 class FieldPositionIteratorHandler : public FieldPositionHandler {
    49   FieldPositionIterator* iter; // can be NULL
    50   UVector32* vec;
    51   UErrorCode status;
    53   // Note, we keep a reference to status, so if status is on the stack, we have
    54   // to be destroyed before status goes out of scope.  Easiest thing is to
    55   // allocate us on the stack in the same (or narrower) scope as status has.
    56   // This attempts to encourage that by blocking heap allocation.
    57   void *operator new(size_t s);
    58   void *operator new[](size_t s);
    60  public:
    61   FieldPositionIteratorHandler(FieldPositionIterator* posIter, UErrorCode& status);
    62   ~FieldPositionIteratorHandler();
    64   virtual void addAttribute(int32_t id, int32_t start, int32_t limit);
    65   virtual void shiftLast(int32_t delta);
    66   virtual UBool isRecording(void);
    67 };
    69 U_NAMESPACE_END
    71 #endif /* !UCONFIG_NO_FORMATTING */
    73 #endif /* FPHDLIMP_H */

mercurial