Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions
LiteralImpl Class Reference
Inheritance diagram for LiteralImpl:
Inheritance graph
[legend]
Collaboration diagram for LiteralImpl:
Collaboration graph
[legend]

List of all members.

Public Member Functions

void GetValueConst ([shared] out wstring aConstValue)
 An unscriptable version used to avoid a string copy.
boolean EqualsNode (in nsIRDFNode aNode)

Static Public Member Functions

static nsresult Create (const PRUnichar *aValue, nsIRDFLiteral **aResult)

Public Attributes

readonly attribute wstring Value
 The Unicode string value of the literal.

Protected Member Functions

 LiteralImpl (const PRUnichar *s)
virtual ~LiteralImpl ()
const PRUnicharGetValue () const

Detailed Description

Definition at line 538 of file nsRDFService.cpp.


Constructor & Destructor Documentation

Definition at line 583 of file nsRDFService.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

LiteralImpl::~LiteralImpl ( ) [protected, virtual]

Definition at line 589 of file nsRDFService.cpp.

{
    gRDFService->UnregisterLiteral(this);

    // Use NS_RELEASE2() here, because we want to decrease the
    // refcount, but not null out the gRDFService pointer (which is
    // what a vanilla NS_RELEASE() would do).
    nsrefcnt refcnt;
    NS_RELEASE2(gRDFService, refcnt);
}

Here is the call graph for this function:


Member Function Documentation

nsresult LiteralImpl::Create ( const PRUnichar aValue,
nsIRDFLiteral **  aResult 
) [static]

Definition at line 564 of file nsRDFService.cpp.

{
    // Goofy math to get alignment right. Copied from nsSharedString.h.
    size_t objectSize = ((sizeof(LiteralImpl) + sizeof(PRUnichar) - 1) / sizeof(PRUnichar)) * sizeof(PRUnichar);
    size_t stringLen = nsCharTraits<PRUnichar>::length(aValue);
    size_t stringSize = (stringLen + 1) * sizeof(PRUnichar);

    void* objectPtr = operator new(objectSize + stringSize);
    if (! objectPtr)
        return NS_ERROR_NULL_POINTER;

    PRUnichar* buf = NS_REINTERPRET_CAST(PRUnichar*, NS_STATIC_CAST(unsigned char*, objectPtr) + objectSize);
    nsCharTraits<PRUnichar>::copy(buf, aValue, stringLen + 1);

    NS_ADDREF(*aResult = new (objectPtr) LiteralImpl(buf));
    return NS_OK;
}

Here is the call graph for this function:

boolean nsIRDFNode::EqualsNode ( in nsIRDFNode  aNode) [inherited]
NS_IMETHODIMP LiteralImpl::GetValue ( void  ) const [inline, protected]

Definition at line 556 of file nsRDFService.cpp.

                                      {
        size_t objectSize = ((sizeof(LiteralImpl) + sizeof(PRUnichar) - 1) / sizeof(PRUnichar)) * sizeof(PRUnichar);
        return NS_REINTERPRET_CAST(const PRUnichar*, NS_REINTERPRET_CAST(const unsigned char*, this) + objectSize);
    }

Here is the call graph for this function:

void nsIRDFLiteral::GetValueConst ( [shared] out wstring  aConstValue) [inherited]

An unscriptable version used to avoid a string copy.

Meant for use as a performance optimization.

Here is the caller graph for this function:


Member Data Documentation

readonly attribute wstring nsIRDFLiteral::Value [inherited]

The Unicode string value of the literal.

Definition at line 54 of file nsIRDFLiteral.idl.


The documentation for this class was generated from the following file: