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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « icu46/source/common/usprep.cpp ('k') | icu46/source/common/ustr_cnv.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 /*
2 **********************************************************************
3 * Copyright (C) 2003-2004, International Business Machines
4 * Corporation and others. All Rights Reserved.
5 **********************************************************************
6 */
7
8 #include "uvector.h"
9
10 U_NAMESPACE_BEGIN
11
12 UOBJECT_DEFINE_RTTI_IMPLEMENTATION(UStack)
13
14 UStack::UStack(UErrorCode &status) :
15 UVector(status)
16 {
17 }
18
19 UStack::UStack(int32_t initialCapacity, UErrorCode &status) :
20 UVector(initialCapacity, status)
21 {
22 }
23
24 UStack::UStack(UObjectDeleter *d, UKeyComparator *c, UErrorCode &status) :
25 UVector(d, c, status)
26 {
27 }
28
29 UStack::UStack(UObjectDeleter *d, UKeyComparator *c, int32_t initialCapacity, UE rrorCode &status) :
30 UVector(d, c, initialCapacity, status)
31 {
32 }
33
34 UStack::~UStack() {}
35
36 void* UStack::pop(void) {
37 int32_t n = size() - 1;
38 void* result = 0;
39 if (n >= 0) {
40 result = elementAt(n);
41 removeElementAt(n);
42 }
43 return result;
44 }
45
46 int32_t UStack::popi(void) {
47 int32_t n = size() - 1;
48 int32_t result = 0;
49 if (n >= 0) {
50 result = elementAti(n);
51 removeElementAt(n);
52 }
53 return result;
54 }
55
56 int32_t UStack::search(void* obj) const {
57 int32_t i = indexOf(obj);
58 return (i >= 0) ? size() - i : i;
59 }
60
61 U_NAMESPACE_END
OLDNEW
« 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