xpcom/string/public/nsLiteralString.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpcom/string/public/nsLiteralString.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,36 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef nsLiteralString_h___
    1.10 +#define nsLiteralString_h___
    1.11 +
    1.12 +#include "nscore.h"
    1.13 +#include "nsString.h"
    1.14 +
    1.15 +  // declare nsLiteralString
    1.16 +#include "string-template-def-unichar.h"
    1.17 +#include "nsTLiteralString.h"
    1.18 +#include "string-template-undef.h"
    1.19 +
    1.20 +  // declare nsLiteralCString
    1.21 +#include "string-template-def-char.h"
    1.22 +#include "nsTLiteralString.h"
    1.23 +#include "string-template-undef.h"
    1.24 +
    1.25 +#include "mozilla/Char16.h"
    1.26 +
    1.27 +#define NS_MULTILINE_LITERAL_STRING(s)            static_cast<const nsLiteralString&>(nsLiteralString(s))
    1.28 +#define NS_MULTILINE_LITERAL_STRING_INIT(n,s)     n(s)
    1.29 +#define NS_NAMED_MULTILINE_LITERAL_STRING(n,s)    const nsLiteralString n(s)
    1.30 +
    1.31 +#define NS_LITERAL_STRING(s)                      static_cast<const nsLiteralString&>(nsLiteralString(MOZ_UTF16(s)))
    1.32 +#define NS_LITERAL_STRING_INIT(n,s)               n(MOZ_UTF16(s))
    1.33 +#define NS_NAMED_LITERAL_STRING(n,s)              const nsLiteralString n(MOZ_UTF16(s))
    1.34 +
    1.35 +#define NS_LITERAL_CSTRING(s)                     static_cast<const nsLiteralCString&>(nsLiteralCString(s))
    1.36 +#define NS_LITERAL_CSTRING_INIT(n,s)              n(s)
    1.37 +#define NS_NAMED_LITERAL_CSTRING(n,s)             const nsLiteralCString n(s)
    1.38 +
    1.39 +#endif /* !defined(nsLiteralString_h___) */

mercurial