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 #include "nsTPromiseFlatString.h"
10 void nsTPromiseFlatString
<T
>::Init(const substring_type
& str
) {
11 if (str
.IsTerminated()) {
13 const_cast<char_type
*>(static_cast<const char_type
*>(str
.Data()));
14 size_type newLength
= str
.Length();
15 DataFlags newDataFlags
=
16 str
.GetDataFlags() & (DataFlags::TERMINATED
| DataFlags::LITERAL
);
17 // does not promote DataFlags::VOIDED
19 this->SetData(newData
, newLength
, newDataFlags
);
25 template class nsTPromiseFlatString
<char>;
26 template class nsTPromiseFlatString
<char16_t
>;