mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-07 12:15:51 +00:00
4824659eb8
--HG-- rename : intl/unicharutil/src/normalization_data.h => intl/unicharutil/normalization_data.h rename : intl/unicharutil/src/nsCaseConversionImp2.cpp => intl/unicharutil/nsCaseConversionImp2.cpp rename : intl/unicharutil/src/nsCaseConversionImp2.h => intl/unicharutil/nsCaseConversionImp2.h rename : intl/unicharutil/src/nsCategoryImp.cpp => intl/unicharutil/nsCategoryImp.cpp rename : intl/unicharutil/src/nsCategoryImp.h => intl/unicharutil/nsCategoryImp.h rename : intl/unicharutil/src/nsEntityConverter.cpp => intl/unicharutil/nsEntityConverter.cpp rename : intl/unicharutil/src/nsEntityConverter.h => intl/unicharutil/nsEntityConverter.h rename : intl/unicharutil/public/nsICaseConversion.h => intl/unicharutil/nsICaseConversion.h rename : intl/unicharutil/idl/nsIEntityConverter.idl => intl/unicharutil/nsIEntityConverter.idl rename : intl/unicharutil/idl/nsISaveAsCharset.idl => intl/unicharutil/nsISaveAsCharset.idl rename : intl/unicharutil/public/nsIUGenCategory.h => intl/unicharutil/nsIUGenCategory.h rename : intl/unicharutil/idl/nsIUnicodeNormalizer.idl => intl/unicharutil/nsIUnicodeNormalizer.idl rename : intl/unicharutil/src/nsSaveAsCharset.cpp => intl/unicharutil/nsSaveAsCharset.cpp rename : intl/unicharutil/src/nsSaveAsCharset.h => intl/unicharutil/nsSaveAsCharset.h rename : intl/unicharutil/public/nsUnicharUtilCIID.h => intl/unicharutil/nsUnicharUtilCIID.h rename : intl/unicharutil/src/nsUnicodeNormalizer.cpp => intl/unicharutil/nsUnicodeNormalizer.cpp rename : intl/unicharutil/public/nsUnicodeNormalizer.h => intl/unicharutil/nsUnicodeNormalizer.h rename : intl/unicharutil/src/ucdata.c => intl/unicharutil/ucdata.c rename : intl/unicharutil/src/ucdata.h => intl/unicharutil/ucdata.h
69 lines
1.8 KiB
C++
69 lines
1.8 KiB
C++
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef nsEntityConverter_h__
|
|
#define nsEntityConverter_h__
|
|
|
|
#include "nsIEntityConverter.h"
|
|
#include "nsIStringBundle.h"
|
|
#include "nsCOMPtr.h"
|
|
|
|
#define kVERSION_STRING_LEN 128
|
|
|
|
class nsEntityVersionList
|
|
{
|
|
public:
|
|
nsEntityVersionList() {}
|
|
|
|
uint32_t mVersion;
|
|
char16_t mEntityListName[kVERSION_STRING_LEN+1];
|
|
nsCOMPtr<nsIStringBundle> mEntities;
|
|
};
|
|
|
|
class nsEntityConverter: public nsIEntityConverter
|
|
{
|
|
public:
|
|
|
|
//
|
|
// implementation methods
|
|
//
|
|
nsEntityConverter();
|
|
|
|
//
|
|
// nsISupports
|
|
//
|
|
NS_DECL_ISUPPORTS
|
|
|
|
//
|
|
// nsIEntityConverter
|
|
//
|
|
NS_IMETHOD ConvertUTF32ToEntity(uint32_t character, uint32_t entityVersion, char **_retval);
|
|
NS_IMETHOD ConvertToEntity(char16_t character, uint32_t entityVersion, char **_retval);
|
|
|
|
NS_IMETHOD ConvertToEntities(const char16_t *inString, uint32_t entityVersion, char16_t **_retval);
|
|
|
|
protected:
|
|
|
|
// load a version property file and generate a version list (number/name pair)
|
|
NS_IMETHOD LoadVersionPropertyFile();
|
|
|
|
// map version number to version string
|
|
const char16_t* GetVersionName(uint32_t versionNumber);
|
|
|
|
// map version number to a string bundle
|
|
nsIStringBundle* GetVersionBundleInstance(uint32_t versionNumber);
|
|
|
|
// load a string bundle file
|
|
already_AddRefed<nsIStringBundle> LoadEntityBundle(uint32_t version);
|
|
|
|
|
|
nsEntityVersionList *mVersionList; // array of version number/name pairs
|
|
uint32_t mVersionListLength; // number of supported versions
|
|
|
|
virtual ~nsEntityConverter();
|
|
};
|
|
|
|
#endif
|