Backed out 2 changesets (bug 1908320) for causing wr failures on align-items-baseline...
[gecko.git] / xpcom / string / nsLiteralString.h
blobf982724ce4831983069a369ba54e4160d1817256
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsLiteralString_h___
8 #define nsLiteralString_h___
10 #include "nscore.h"
11 #include "nsString.h"
13 #include "nsTLiteralString.h"
15 #include "mozilla/Char16.h"
17 #define NS_CSTRING_LITERAL_AS_STRING_LITERAL(s) u"" s
19 #define NS_LITERAL_STRING_FROM_CSTRING(s) \
20 static_cast<const nsLiteralString&>( \
21 nsLiteralString(NS_CSTRING_LITERAL_AS_STRING_LITERAL(s)))
23 constexpr auto operator""_ns(const char* aStr, std::size_t aLen) {
24 return nsLiteralCString{aStr, aLen};
27 constexpr auto operator""_ns(const char16_t* aStr, std::size_t aLen) {
28 return nsLiteralString{aStr, aLen};
31 #endif /* !defined(nsLiteralString_h___) */