home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 6 / AACD06.ISO / AACD / Programming / ICU / src / icu / source / i18n / brkiter.cpp next >
Encoding:
C/C++ Source or Header  |  1999-08-16  |  4.0 KB  |  119 lines

  1. /*
  2. *****************************************************************************************
  3. *                                                                                       *
  4. * COPYRIGHT:                                                                            *
  5. *   (C) Copyright Taligent, Inc.,  1997                                                 *
  6. *   (C) Copyright International Business Machines Corporation,  1997-1998                    *
  7. *   Licensed Material - Program-Property of IBM - All Rights Reserved.                  *
  8. *   US Government Users Restricted Rights - Use, duplication, or disclosure             *
  9. *   restricted by GSA ADP Schedule Contract with IBM Corp.                              *
  10. *                                                                                       *
  11. *****************************************************************************************
  12. *
  13. * File TXTBDRY.CPP
  14. *
  15. * Modification History:
  16. *
  17. *   Date        Name        Description
  18. *   02/18/97    aliu        Converted from OpenClass.  Added DONE.
  19. *****************************************************************************************
  20. */
  21.  
  22. // *****************************************************************************
  23. // This file was generated from the java source file BreakIterator.java
  24. // *****************************************************************************
  25.  
  26. #include "utypes.h"
  27. #include "brkiter.h"
  28. #include "simtxbd.h"
  29.  
  30. #include <string.h>
  31.  
  32. // *****************************************************************************
  33. // class BreakIterator
  34. // This class implements methods for finding the location of boundaries in text. 
  35. // Instances of BreakIterator maintain a current position and scan over text
  36. // returning the index of characters where boundaries occur.
  37. // *****************************************************************************
  38.  
  39. const UTextOffset BreakIterator::DONE = (int32_t)-1;
  40.  
  41. // -------------------------------------
  42.  
  43. // Creates a simple text boundary for word breaks.
  44. BreakIterator*
  45. BreakIterator::createWordInstance(const Locale& key)
  46. {
  47.     return new SimpleTextBoundary(&TextBoundaryData::kWordBreakData);
  48. }
  49.  
  50. // -------------------------------------
  51.  
  52. // Creates a simple text boundary for line breaks.
  53. BreakIterator*
  54. BreakIterator::createLineInstance(const Locale& key)
  55. {
  56.     return new SimpleTextBoundary(&TextBoundaryData::kLineBreakData);
  57. }
  58.  
  59. // -------------------------------------
  60.  
  61. // Creates a simple text boundary for character breaks.
  62. BreakIterator*
  63. BreakIterator::createCharacterInstance(const Locale& key)
  64. {
  65.     return new SimpleTextBoundary(&TextBoundaryData::kCharacterBreakData);
  66. }
  67.  
  68. // -------------------------------------
  69.  
  70. // Creates a simple text boundary for sentence breaks.
  71. BreakIterator*
  72. BreakIterator::createSentenceInstance(const Locale& key)
  73. {
  74.     return new SimpleTextBoundary(&TextBoundaryData::kSentenceBreakData);
  75. }
  76.  
  77. // -------------------------------------
  78.  
  79. // Gets all the available locales that has localized text boundary data.
  80. const Locale*
  81. BreakIterator::getAvailableLocales(int32_t& count)
  82. {
  83.     return Locale::getAvailableLocales(count);
  84. }
  85.  
  86. // -------------------------------------
  87. // Gets the objectLocale display name in the default locale language.
  88. UnicodeString&
  89. BreakIterator::getDisplayName(const Locale& objectLocale,
  90.                              UnicodeString& name)
  91. {
  92.     return objectLocale.getDisplayName(name);
  93. }
  94.  
  95. // -------------------------------------
  96. // Gets the objectLocale display name in the displayLocale language.
  97. UnicodeString&
  98. BreakIterator::getDisplayName(const Locale& objectLocale,
  99.                              const Locale& displayLocale,
  100.                              UnicodeString& name)
  101. {
  102.     return objectLocale.getDisplayName(displayLocale, name);
  103. }
  104.  
  105. // -------------------------------------
  106.  
  107. // Needed because we declare the copy constructor (in order to prevent synthesizing one) and
  108. // so the default constructor is no longer synthesized.
  109.  
  110. BreakIterator::BreakIterator()
  111. {
  112. }
  113.  
  114. BreakIterator::~BreakIterator()
  115. {
  116. }
  117.  
  118. //eof
  119.