intl/strres/src/nsStringBundleService.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef nsStringBundleService_h__
     7 #define nsStringBundleService_h__
     9 #include "nsCOMPtr.h"
    10 #include "nsDataHashtable.h"
    11 #include "nsHashKeys.h"
    12 #include "nsIPersistentProperties2.h"
    13 #include "nsIStringBundle.h"
    14 #include "nsIObserver.h"
    15 #include "nsWeakReference.h"
    16 #include "nsIErrorService.h"
    17 #include "nsIStringBundleOverride.h"
    19 #include "mozilla/LinkedList.h"
    21 struct bundleCacheEntry_t;
    23 class nsStringBundleService : public nsIStringBundleService,
    24                               public nsIObserver,
    25                               public nsSupportsWeakReference
    26 {
    27 public:
    28   nsStringBundleService();
    29   virtual ~nsStringBundleService();
    31   nsresult Init();
    33   NS_DECL_ISUPPORTS
    34   NS_DECL_NSISTRINGBUNDLESERVICE
    35   NS_DECL_NSIOBSERVER
    37 private:
    38   nsresult getStringBundle(const char *aUrl, nsIStringBundle** aResult);
    39   nsresult FormatWithBundle(nsIStringBundle* bundle, nsresult aStatus,
    40                             uint32_t argCount, char16_t** argArray,
    41                             char16_t* *result);
    43   void flushBundleCache();
    45   bundleCacheEntry_t *insertIntoCache(already_AddRefed<nsIStringBundle> aBundle,
    46                                       nsCString &aHashKey);
    48   nsDataHashtable<nsCStringHashKey, bundleCacheEntry_t*> mBundleMap;
    49   mozilla::LinkedList<bundleCacheEntry_t> mBundleCache;
    51   nsCOMPtr<nsIErrorService> mErrorService;
    52   nsCOMPtr<nsIStringBundleOverride> mOverrideStrings;
    53 };
    55 #endif

mercurial