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: michael@0: /** michael@0: * nsTLiteralString_CharT michael@0: * michael@0: * Stores a null-terminated, immutable sequence of characters. michael@0: * michael@0: * Subclass of nsTString that restricts string value to a literal michael@0: * character sequence. This class does not own its data. The data is michael@0: * assumed to be permanent. In practice this is true because this code michael@0: * is only usable by and for libxul. michael@0: */ michael@0: class nsTLiteralString_CharT : public nsTString_CharT michael@0: { michael@0: public: michael@0: michael@0: typedef nsTLiteralString_CharT self_type; michael@0: michael@0: public: michael@0: michael@0: /** michael@0: * constructor michael@0: */ michael@0: michael@0: template michael@0: nsTLiteralString_CharT( const char_type (&str)[N] ) michael@0: : string_type(const_cast(str), N - 1, F_TERMINATED | F_LITERAL) michael@0: { michael@0: } michael@0: michael@0: private: michael@0: michael@0: // NOT TO BE IMPLEMENTED michael@0: template michael@0: nsTLiteralString_CharT( char_type (&str)[N] ) MOZ_DELETE; michael@0: };