summaryrefslogtreecommitdiff
path: root/ext/intl/breakiterator/breakiterator_methods.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/breakiterator/breakiterator_methods.cpp')
-rw-r--r--ext/intl/breakiterator/breakiterator_methods.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/ext/intl/breakiterator/breakiterator_methods.cpp b/ext/intl/breakiterator/breakiterator_methods.cpp
index 5b8f859d52..e9e6b19ba3 100644
--- a/ext/intl/breakiterator/breakiterator_methods.cpp
+++ b/ext/intl/breakiterator/breakiterator_methods.cpp
@@ -19,6 +19,7 @@
#endif
#include <unicode/brkiter.h>
+#include "codepointiterator_internal.h"
#include "breakiterator_iterators.h"
@@ -29,6 +30,8 @@ extern "C" {
#include <zend_exceptions.h>
}
+using PHP::CodePointBreakIterator;
+
U_CFUNC PHP_METHOD(BreakIterator, __construct)
{
zend_throw_exception( NULL,
@@ -107,6 +110,21 @@ U_CFUNC PHP_FUNCTION(breakiter_create_title_instance)
INTERNAL_FUNCTION_PARAM_PASSTHRU);
}
+U_CFUNC PHP_FUNCTION(breakiter_create_code_point_instance)
+{
+ UErrorCode status = UErrorCode();
+ intl_error_reset(NULL TSRMLS_CC);
+
+ if (zend_parse_parameters_none() == FAILURE) {
+ intl_error_set(NULL, U_ILLEGAL_ARGUMENT_ERROR,
+ "breakiter_create_code_point_instance: bad arguments", 0 TSRMLS_CC);
+ RETURN_NULL();
+ }
+
+ CodePointBreakIterator *cpbi = new CodePointBreakIterator();
+ breakiterator_object_create(return_value, cpbi TSRMLS_CC);
+}
+
U_CFUNC PHP_FUNCTION(breakiter_get_text)
{
BREAKITER_METHOD_INIT_VARS;