gecko/xpcom/ds/nsSupportsPrimitives.h
Ehsan Akhgari 0fd9123eac Bug 579517 - Part 1: Automated conversion of NSPR numeric types to stdint types in Gecko; r=bsmedberg
This patch was generated by a script.  Here's the source of the script for
future reference:

function convert() {
echo "Converting $1 to $2..."
find . ! -wholename "*nsprpub*" \
       ! -wholename "*security/nss*" \
       ! -wholename "*/.hg*" \
       ! -wholename "obj-ff-dbg*" \
       ! -name nsXPCOMCID.h \
       ! -name prtypes.h \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert PRInt8 int8_t
convert PRUint8 uint8_t
convert PRInt16 int16_t
convert PRUint16 uint16_t
convert PRInt32 int32_t
convert PRUint32 uint32_t
convert PRInt64 int64_t
convert PRUint64 uint64_t

convert PRIntn int
convert PRUintn unsigned

convert PRSize size_t

convert PROffset32 int32_t
convert PROffset64 int64_t

convert PRPtrdiff ptrdiff_t

convert PRFloat64 double
2012-08-22 11:56:38 -04:00

328 lines
6.6 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* 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 nsSupportsPrimitives_h__
#define nsSupportsPrimitives_h__
#include "mozilla/Attributes.h"
#include "nsISupportsPrimitives.h"
#include "nsCOMPtr.h"
#include "nsString.h"
#include "nsDependentString.h"
class nsSupportsIDImpl MOZ_FINAL : public nsISupportsID
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRIMITIVE
NS_DECL_NSISUPPORTSID
nsSupportsIDImpl();
private:
~nsSupportsIDImpl() { }
nsID *mData;
};
/***************************************************************************/
class nsSupportsCStringImpl MOZ_FINAL : public nsISupportsCString
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRIMITIVE
NS_DECL_NSISUPPORTSCSTRING
nsSupportsCStringImpl() {}
private:
~nsSupportsCStringImpl() {}
nsCString mData;
};
/***************************************************************************/
class nsSupportsStringImpl MOZ_FINAL : public nsISupportsString
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRIMITIVE
NS_DECL_NSISUPPORTSSTRING
nsSupportsStringImpl() {}
private:
~nsSupportsStringImpl() {}
nsString mData;
};
/***************************************************************************/
class nsSupportsPRBoolImpl MOZ_FINAL : public nsISupportsPRBool
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRIMITIVE
NS_DECL_NSISUPPORTSPRBOOL
nsSupportsPRBoolImpl();
private:
~nsSupportsPRBoolImpl() {}
bool mData;
};
/***************************************************************************/
class nsSupportsPRUint8Impl MOZ_FINAL : public nsISupportsPRUint8
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRIMITIVE
NS_DECL_NSISUPPORTSPRUINT8
nsSupportsPRUint8Impl();
private:
~nsSupportsPRUint8Impl() {}
uint8_t mData;
};
/***************************************************************************/
class nsSupportsPRUint16Impl MOZ_FINAL : public nsISupportsPRUint16
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRIMITIVE
NS_DECL_NSISUPPORTSPRUINT16
nsSupportsPRUint16Impl();
private:
~nsSupportsPRUint16Impl() {}
uint16_t mData;
};
/***************************************************************************/
class nsSupportsPRUint32Impl MOZ_FINAL : public nsISupportsPRUint32
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRIMITIVE
NS_DECL_NSISUPPORTSPRUINT32
nsSupportsPRUint32Impl();
private:
~nsSupportsPRUint32Impl() {}
uint32_t mData;
};
/***************************************************************************/
class nsSupportsPRUint64Impl MOZ_FINAL : public nsISupportsPRUint64
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRIMITIVE
NS_DECL_NSISUPPORTSPRUINT64
nsSupportsPRUint64Impl();
private:
~nsSupportsPRUint64Impl() {}
uint64_t mData;
};
/***************************************************************************/
class nsSupportsPRTimeImpl MOZ_FINAL : public nsISupportsPRTime
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRIMITIVE
NS_DECL_NSISUPPORTSPRTIME
nsSupportsPRTimeImpl();
private:
~nsSupportsPRTimeImpl() {}
PRTime mData;
};
/***************************************************************************/
class nsSupportsCharImpl MOZ_FINAL : public nsISupportsChar
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRIMITIVE
NS_DECL_NSISUPPORTSCHAR
nsSupportsCharImpl();
private:
~nsSupportsCharImpl() {}
char mData;
};
/***************************************************************************/
class nsSupportsPRInt16Impl MOZ_FINAL : public nsISupportsPRInt16
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRIMITIVE
NS_DECL_NSISUPPORTSPRINT16
nsSupportsPRInt16Impl();
private:
~nsSupportsPRInt16Impl() {}
int16_t mData;
};
/***************************************************************************/
class nsSupportsPRInt32Impl MOZ_FINAL : public nsISupportsPRInt32
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRIMITIVE
NS_DECL_NSISUPPORTSPRINT32
nsSupportsPRInt32Impl();
private:
~nsSupportsPRInt32Impl() {}
int32_t mData;
};
/***************************************************************************/
class nsSupportsPRInt64Impl MOZ_FINAL : public nsISupportsPRInt64
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRIMITIVE
NS_DECL_NSISUPPORTSPRINT64
nsSupportsPRInt64Impl();
private:
~nsSupportsPRInt64Impl() {}
int64_t mData;
};
/***************************************************************************/
class nsSupportsFloatImpl MOZ_FINAL : public nsISupportsFloat
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRIMITIVE
NS_DECL_NSISUPPORTSFLOAT
nsSupportsFloatImpl();
private:
~nsSupportsFloatImpl() {}
float mData;
};
/***************************************************************************/
class nsSupportsDoubleImpl MOZ_FINAL : public nsISupportsDouble
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRIMITIVE
NS_DECL_NSISUPPORTSDOUBLE
nsSupportsDoubleImpl();
private:
~nsSupportsDoubleImpl() {}
double mData;
};
/***************************************************************************/
class nsSupportsVoidImpl MOZ_FINAL : public nsISupportsVoid
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRIMITIVE
NS_DECL_NSISUPPORTSVOID
nsSupportsVoidImpl();
private:
~nsSupportsVoidImpl() {}
void* mData;
};
/***************************************************************************/
class nsSupportsInterfacePointerImpl MOZ_FINAL : public nsISupportsInterfacePointer
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRIMITIVE
NS_DECL_NSISUPPORTSINTERFACEPOINTER
nsSupportsInterfacePointerImpl();
private:
~nsSupportsInterfacePointerImpl();
nsCOMPtr<nsISupports> mData;
nsID *mIID;
};
/***************************************************************************/
/**
* Wraps a static const char* buffer for use with nsISupportsCString
*
* Only use this class with static buffers, or arena-allocated buffers of
* permanent lifetime!
*/
class nsSupportsDependentCString MOZ_FINAL : public nsISupportsCString
{
public:
NS_DECL_ISUPPORTS
NS_DECL_NSISUPPORTSPRIMITIVE
NS_DECL_NSISUPPORTSCSTRING
nsSupportsDependentCString(const char* aStr);
private:
~nsSupportsDependentCString() {}
nsDependentCString mData;
};
#endif /* nsSupportsPrimitives_h__ */