/*
******************************************************************************
-* Copyright (C) 1997-2008, International Business Machines
+* Copyright (C) 1997-2012, International Business Machines
* Corporation and others. All Rights Reserved.
******************************************************************************
* file name: nfrlist.h
NFRuleList(uint32_t capacity = 10)
: fStuff(capacity ? (NFRule**)uprv_malloc(capacity * sizeof(NFRule*)) : NULL)
, fCount(0)
- , fCapacity(capacity) {};
+ , fCapacity(capacity) {}
~NFRuleList() {
if (fStuff) {
for(uint32_t i = 0; i < fCount; ++i) {
fCapacity = 0;
return result;
}
+ void deleteAll() {
+ NFRule** tmp = NULL;
+ int32_t size = fCount;
+ if (size > 0) {
+ tmp = release();
+ for (int32_t i = 0; i < size; i++) {
+ delete tmp[i];
+ }
+ if (tmp) {
+ uprv_free(tmp);
+ }
+ }
+ }
private:
NFRuleList(const NFRuleList &other); // forbid copying of this class