mirror of
https://github.com/roytam1/palemoon27.git
synced 2026-07-20 22:19:49 +00:00
5d8f4a0ceb
- Bug 1130710 - xre: Use stdint uint*_t instead of nonstandard __uint*_t. r=bsmedberg# Please enter the commit message for your changes. Lines starting (8ee5fbe479) - partial revert of PM (bcd354aa6b) - Bug 1158866 - Enable MAR verification on linux via NSS. r=rstrong (d3a4eff858) - Bug 1159090 - Only append library path for updater if it is a unique value. r=rstrong (5aeece0f47) - Bug 1168720 - Remove use of test env var MOZ_NO_REPLACE_FALLBACK and associated tests that are covered by other tests. r=spohl (4c8fb7266d) - more backport (a30d3a5c9d) - Bug 1158870: Disable mar signing code path in updater for gonk until mar signing is available there. r=bbondy (d08701cdb4) - Bug 1217985 - Don't depend on Windows crypto DLLs (e313b1d3b7) - more backports (fa8e0ff050) - Bug 1168009 - heap-use-after-free (ASAN build) in updater.cpp mstrtok. r=spohl (9ffe217d90) - Bug 1234033 - Unbreak build --with-system-bz2 using Clang. r=dvander (1109f20b70) - backports (3f418fc789) - Bug 1213130 - Make several string function to accept char16ptr_t instead of char16_t*, and remove redundant overloads. rs=froydnj (95a4cb53cd) - Bug 1210871 - don't use reinterpret_cast in nsTHashtable.h; r=erahm (f742409381) - Bug 1217125 - remove pointless includes from nsTHashtable.h; r=mccr8 (ad26d04f77) - Bug 1159081 - Bad PR_SetEnv usage for Gonk. r=dhylands, r=rstrong (855a00ae4b) - bit of Bug 1237140 - Move DefinesAction (d0d8fffb86) - Bug 1157212 - Teach clang-analyzer about XPT_ASSERT; r=froydnj (d75e87012c) - Bug 1208320 - Do not stage some reftest support files before archiving; r=glandium (5a547ca126) - Bug 1208320 - Do not stage reftest test files before archiving; r=glandium (28944e3a87) - Bug 1208320 - Print message when done with archiving; r=glandium (27e0b00dcd) - Bug 1208320 - Decrease compression level of test zip archives; r=glandium (d01f75ea8b) - Bug 1232887 - "make package MOZ_PKG_PRETTYNAMES=1" is busted. r=glandium (9f978b70f0) - Bug 1212609 - Add common test package rules for firefox-ui-tests. r=gps (3fa329714a) - Bug 1239442 - Update common.tests.zip to contain dom/media/test/external-media-sites. r=gps (94e917c5e7) - Bug 1233774 - fix Leak EventTokenBucket on shutdown r=dragana (37db0e5752) - Bug 1241295 - Limit time for PR_Close calls during shutdown in nsUDPSocket. r=mcmanus (451f8663b9) - Bug 1242464 - Call shutdown() before closesocket() and change linger option on windows. r=mcmanus (2b4f7e327c) - Bug 1240122 - threadsafe fix for getselfaddr() r=dragana (0cdeefb33e) - Bug 544986 - 64KB rwin for windows xp r=dragana (cbe034ebf5) - Bug 1239655 - Do not do PR_ConnectContinue during the shutdown. r=mcmanus (2361129b62) - Bug 1240120 - Move external-media-tests to subdirectory to generate correct packaging; r=maja_zf,whimboo (0742e93414) - Bug 1235232 - Fix -Wclass-varargs warnings in dom/media/. r=kentuckyfriedtakahe (b13b325846) - Bug 1231793: Part 1 - Added read functions for Little Endian integers to ByteReader.h. r=jya (6dc6519fe9) - Bug 1231793: Part 2 - Added conversions to AudioSampleFormat.h. r=jya (59d48c4d82) - Bug 1231793: Part 3 - Fixed reading of Metadata tags. r=jya (3931a82ce7) - Bug 1192539 - [2.4] Use MediaCodecList to check for decoder support. r=snorp (35e0427a2b) - Bug 1231793: Part 4 - Added checks for Wave type in AndroidDecoderModule. r=jya (a80b83691c) - Bug 1237836 - Add support for MetadataTags to MediaFormatReader. r=jya (9b813ae38c) - Bug 1231793: Part 5 - Added Wave Data Demuxer and Decoder. r=jya (6f7131a2d8) - Bug 1231793: Part 6 - Enabled the new Wave Data Decoder in DecoderTraits. r=jya (1574922fc7) - Bug 1241677: P1. Add MediaDataDecoder::GetDescriptionName() method. r=cpearce (767413678e) - Bug 1241677: P2. Add media decoder's description to about:media report. r=cpearce (b6d300d864) - Bug 1231793: Part 7 - Fixed various tests. r=jya (baa4a844c1) - Bug 1231793: Part 8 - Added checks for various metadata errors. r=jya (53af45d8de)
192 lines
4.3 KiB
C++
192 lines
4.3 KiB
C++
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
#ifndef nsString_h___
|
|
#define nsString_h___
|
|
|
|
#include "mozilla/Attributes.h"
|
|
|
|
#include "nsSubstring.h"
|
|
#include "nsDependentSubstring.h"
|
|
#include "nsReadableUtils.h"
|
|
|
|
#include <new>
|
|
|
|
// enable support for the obsolete string API if not explicitly disabled
|
|
#ifndef MOZ_STRING_WITH_OBSOLETE_API
|
|
#define MOZ_STRING_WITH_OBSOLETE_API 1
|
|
#endif
|
|
|
|
#if MOZ_STRING_WITH_OBSOLETE_API
|
|
// radix values for ToInteger/AppendInt
|
|
#define kRadix10 (10)
|
|
#define kRadix16 (16)
|
|
#define kAutoDetect (100)
|
|
#define kRadixUnknown (kAutoDetect+1)
|
|
#define IGNORE_CASE (true)
|
|
#endif
|
|
|
|
|
|
// declare nsString, et. al.
|
|
#include "string-template-def-unichar.h"
|
|
#include "nsTString.h"
|
|
#include "string-template-undef.h"
|
|
|
|
// declare nsCString, et. al.
|
|
#include "string-template-def-char.h"
|
|
#include "nsTString.h"
|
|
#include "string-template-undef.h"
|
|
|
|
static_assert(sizeof(char16_t) == 2, "size of char16_t must be 2");
|
|
static_assert(sizeof(nsString::char_type) == 2,
|
|
"size of nsString::char_type must be 2");
|
|
static_assert(nsString::char_type(-1) > nsString::char_type(0),
|
|
"nsString::char_type must be unsigned");
|
|
static_assert(sizeof(nsCString::char_type) == 1,
|
|
"size of nsCString::char_type must be 1");
|
|
|
|
|
|
/**
|
|
* A helper class that converts a UTF-16 string to ASCII in a lossy manner
|
|
*/
|
|
class NS_LossyConvertUTF16toASCII : public nsAutoCString
|
|
{
|
|
public:
|
|
explicit NS_LossyConvertUTF16toASCII(const char16ptr_t aString)
|
|
{
|
|
LossyAppendUTF16toASCII(aString, *this);
|
|
}
|
|
|
|
NS_LossyConvertUTF16toASCII(const char16ptr_t aString, uint32_t aLength)
|
|
{
|
|
LossyAppendUTF16toASCII(Substring(aString, aLength), *this);
|
|
}
|
|
|
|
explicit NS_LossyConvertUTF16toASCII(const nsAString& aString)
|
|
{
|
|
LossyAppendUTF16toASCII(aString, *this);
|
|
}
|
|
|
|
private:
|
|
// NOT TO BE IMPLEMENTED
|
|
NS_LossyConvertUTF16toASCII(char) = delete;
|
|
};
|
|
|
|
|
|
class NS_ConvertASCIItoUTF16 : public nsAutoString
|
|
{
|
|
public:
|
|
explicit NS_ConvertASCIItoUTF16(const char* aCString)
|
|
{
|
|
AppendASCIItoUTF16(aCString, *this);
|
|
}
|
|
|
|
NS_ConvertASCIItoUTF16(const char* aCString, uint32_t aLength)
|
|
{
|
|
AppendASCIItoUTF16(Substring(aCString, aLength), *this);
|
|
}
|
|
|
|
explicit NS_ConvertASCIItoUTF16(const nsACString& aCString)
|
|
{
|
|
AppendASCIItoUTF16(aCString, *this);
|
|
}
|
|
|
|
private:
|
|
// NOT TO BE IMPLEMENTED
|
|
NS_ConvertASCIItoUTF16(char16_t) = delete;
|
|
};
|
|
|
|
|
|
/**
|
|
* A helper class that converts a UTF-16 string to UTF-8
|
|
*/
|
|
class NS_ConvertUTF16toUTF8 : public nsAutoCString
|
|
{
|
|
public:
|
|
explicit NS_ConvertUTF16toUTF8(const char16ptr_t aString)
|
|
{
|
|
AppendUTF16toUTF8(aString, *this);
|
|
}
|
|
|
|
NS_ConvertUTF16toUTF8(const char16ptr_t aString, uint32_t aLength)
|
|
{
|
|
AppendUTF16toUTF8(Substring(aString, aLength), *this);
|
|
}
|
|
|
|
explicit NS_ConvertUTF16toUTF8(const nsAString& aString)
|
|
{
|
|
AppendUTF16toUTF8(aString, *this);
|
|
}
|
|
|
|
private:
|
|
// NOT TO BE IMPLEMENTED
|
|
NS_ConvertUTF16toUTF8(char) = delete;
|
|
};
|
|
|
|
|
|
class NS_ConvertUTF8toUTF16 : public nsAutoString
|
|
{
|
|
public:
|
|
explicit NS_ConvertUTF8toUTF16(const char* aCString)
|
|
{
|
|
AppendUTF8toUTF16(aCString, *this);
|
|
}
|
|
|
|
NS_ConvertUTF8toUTF16(const char* aCString, uint32_t aLength)
|
|
{
|
|
AppendUTF8toUTF16(Substring(aCString, aLength), *this);
|
|
}
|
|
|
|
explicit NS_ConvertUTF8toUTF16(const nsACString& aCString)
|
|
{
|
|
AppendUTF8toUTF16(aCString, *this);
|
|
}
|
|
|
|
private:
|
|
// NOT TO BE IMPLEMENTED
|
|
NS_ConvertUTF8toUTF16(char16_t) = delete;
|
|
};
|
|
|
|
|
|
#ifdef MOZ_USE_CHAR16_WRAPPER
|
|
|
|
inline char16_t*
|
|
wwc(wchar_t* aStr)
|
|
{
|
|
return reinterpret_cast<char16_t*>(aStr);
|
|
}
|
|
|
|
inline wchar_t*
|
|
wwc(char16_t* aStr)
|
|
{
|
|
return reinterpret_cast<wchar_t*>(aStr);
|
|
}
|
|
|
|
#else
|
|
|
|
inline char16_t*
|
|
wwc(char16_t* aStr)
|
|
{
|
|
return aStr;
|
|
}
|
|
|
|
#endif
|
|
|
|
// the following are included/declared for backwards compatibility
|
|
typedef nsAutoString nsVoidableString;
|
|
|
|
#include "nsDependentString.h"
|
|
#include "nsLiteralString.h"
|
|
#include "nsPromiseFlatString.h"
|
|
|
|
// need to include these for backwards compatibility
|
|
#include "nsMemory.h"
|
|
#include <string.h>
|
|
#include <stdio.h>
|
|
#include "plhash.h"
|
|
|
|
#endif // !defined(nsString_h___)
|