michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim:set ts=2 sw=2 sts=2 et cindent: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: void michael@0: nsTPromiseFlatString_CharT::Init(const substring_type& str) michael@0: { michael@0: if (str.IsTerminated()) michael@0: { michael@0: mData = const_cast(static_cast(str.Data())); michael@0: mLength = str.Length(); michael@0: mFlags = str.mFlags & (F_TERMINATED | F_LITERAL); michael@0: // does not promote F_VOIDED michael@0: } michael@0: else michael@0: { michael@0: Assign(str); michael@0: } michael@0: }