Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2450)

Unified Diff: icu46/source/common/ustack.cpp

Issue 5516007: Check in the pristine copy of ICU 4.6... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « icu46/source/common/usprep.cpp ('k') | icu46/source/common/ustr_cnv.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: icu46/source/common/ustack.cpp
===================================================================
--- icu46/source/common/ustack.cpp (revision 0)
+++ icu46/source/common/ustack.cpp (revision 0)
@@ -0,0 +1,61 @@
+/*
+**********************************************************************
+* Copyright (C) 2003-2004, International Business Machines
+* Corporation and others. All Rights Reserved.
+**********************************************************************
+*/
+
+#include "uvector.h"
+
+U_NAMESPACE_BEGIN
+
+UOBJECT_DEFINE_RTTI_IMPLEMENTATION(UStack)
+
+UStack::UStack(UErrorCode &status) :
+ UVector(status)
+{
+}
+
+UStack::UStack(int32_t initialCapacity, UErrorCode &status) :
+ UVector(initialCapacity, status)
+{
+}
+
+UStack::UStack(UObjectDeleter *d, UKeyComparator *c, UErrorCode &status) :
+ UVector(d, c, status)
+{
+}
+
+UStack::UStack(UObjectDeleter *d, UKeyComparator *c, int32_t initialCapacity, UErrorCode &status) :
+ UVector(d, c, initialCapacity, status)
+{
+}
+
+UStack::~UStack() {}
+
+void* UStack::pop(void) {
+ int32_t n = size() - 1;
+ void* result = 0;
+ if (n >= 0) {
+ result = elementAt(n);
+ removeElementAt(n);
+ }
+ return result;
+}
+
+int32_t UStack::popi(void) {
+ int32_t n = size() - 1;
+ int32_t result = 0;
+ if (n >= 0) {
+ result = elementAti(n);
+ removeElementAt(n);
+ }
+ return result;
+}
+
+int32_t UStack::search(void* obj) const {
+ int32_t i = indexOf(obj);
+ return (i >= 0) ? size() - i : i;
+}
+
+U_NAMESPACE_END
Property changes on: icu46/source/common/ustack.cpp
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « icu46/source/common/usprep.cpp ('k') | icu46/source/common/ustr_cnv.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698