1999-08-16 21:50:52 +00:00
|
|
|
/*
|
2001-03-21 20:44:20 +00:00
|
|
|
******************************************************************************
|
1999-12-13 22:28:37 +00:00
|
|
|
*
|
2001-03-21 20:44:20 +00:00
|
|
|
* Copyright (C) 1998-2001, International Business Machines
|
1999-12-13 22:28:37 +00:00
|
|
|
* Corporation and others. All Rights Reserved.
|
|
|
|
*
|
2001-03-21 20:44:20 +00:00
|
|
|
******************************************************************************
|
1999-08-16 21:50:52 +00:00
|
|
|
*
|
|
|
|
* File rbdata.h
|
|
|
|
*
|
|
|
|
* Modification History:
|
|
|
|
*
|
|
|
|
* Date Name Description
|
|
|
|
* 06/11/99 stephen Creation. (Moved here from resbund.cpp)
|
2001-03-21 20:44:20 +00:00
|
|
|
******************************************************************************
|
1999-08-16 21:50:52 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef RBDATA_H
|
|
|
|
#define RBDATA_H 1
|
|
|
|
|
1999-12-28 23:39:02 +00:00
|
|
|
#include "unicode/utypes.h"
|
2000-03-29 19:17:17 +00:00
|
|
|
#include "hash.h"
|
1999-12-28 23:39:02 +00:00
|
|
|
#include "unicode/unistr.h"
|
1999-08-16 21:50:52 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Abstract base class for data stored in resource bundles. These
|
|
|
|
* objects are kept in hashtables, indexed by strings. We never need
|
|
|
|
* to copy or clone these objects, since they are created once and
|
|
|
|
* never deleted.
|
|
|
|
*/
|
|
|
|
class ResourceBundleData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~ResourceBundleData() {}
|
1999-10-18 23:44:20 +00:00
|
|
|
virtual UClassID getDynamicClassID(void) const = 0;
|
2000-05-15 18:39:17 +00:00
|
|
|
UErrorCode fCreationStatus;
|
1999-08-16 21:50:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/** Concrete data class representing a list of strings. */
|
|
|
|
class StringList : public ResourceBundleData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
StringList();
|
|
|
|
StringList(UnicodeString* adopted, int32_t count);
|
|
|
|
virtual ~StringList();
|
|
|
|
const UnicodeString& operator[](int32_t i) const;
|
1999-10-18 23:44:20 +00:00
|
|
|
virtual UClassID getDynamicClassID(void) const;
|
|
|
|
static UClassID getStaticClassID(void);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
static UClassID fgClassID;
|
1999-08-16 21:50:52 +00:00
|
|
|
int32_t fCount;
|
|
|
|
UnicodeString *fStrings;
|
|
|
|
};
|
|
|
|
|
|
|
|
/** Concrete data class representing a 2-dimensional list of strings. */
|
|
|
|
class String2dList : public ResourceBundleData
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
String2dList();
|
|
|
|
String2dList(UnicodeString** adopted, int32_t rowCount, int32_t colCount);
|
|
|
|
virtual ~String2dList();
|
|
|
|
const UnicodeString& getString(int32_t rowIndex, int32_t colIndex);
|
1999-10-18 23:44:20 +00:00
|
|
|
virtual UClassID getDynamicClassID(void) const;
|
|
|
|
static UClassID getStaticClassID(void);
|
1999-08-16 21:50:52 +00:00
|
|
|
|
1999-10-18 23:44:20 +00:00
|
|
|
static UClassID fgClassID;
|
1999-08-16 21:50:52 +00:00
|
|
|
int32_t fRowCount;
|
|
|
|
int32_t fColCount;
|
|
|
|
UnicodeString **fStrings;
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Concrete data class representing a tagged list of strings. This is
|
|
|
|
* implemented using a hash table.
|
|
|
|
*/
|
|
|
|
class TaggedList : public ResourceBundleData
|
|
|
|
{
|
2000-03-29 19:17:17 +00:00
|
|
|
Hashtable *hash;
|
1999-08-16 21:50:52 +00:00
|
|
|
|
2000-03-29 19:17:17 +00:00
|
|
|
public:
|
|
|
|
TaggedList();
|
|
|
|
virtual ~TaggedList();
|
|
|
|
|
|
|
|
void put(const UnicodeString& tag, const UnicodeString& data);
|
|
|
|
const UnicodeString* get(const UnicodeString& tag) const;
|
2000-05-18 22:08:39 +00:00
|
|
|
UBool nextElement(const UnicodeString*& key,
|
2000-03-29 19:17:17 +00:00
|
|
|
const UnicodeString*& value,
|
|
|
|
int32_t& pos) const;
|
|
|
|
int32_t count() const;
|
1999-08-16 21:50:52 +00:00
|
|
|
|
2000-03-29 19:17:17 +00:00
|
|
|
virtual UClassID getDynamicClassID(void) const;
|
|
|
|
static UClassID getStaticClassID(void);
|
|
|
|
|
|
|
|
static UClassID fgClassID;
|
1999-08-16 21:50:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|