sbLibraryConstraints.cpp File Reference
#include "sbLibraryConstraints.h"
#include "sbLibraryCID.h"
#include <nsAutoPtr.h>
#include <nsArrayEnumerator.h>
#include <nsCOMArray.h>
#include <nsIClassInfoImpl.h>
#include <nsINetUtil.h>
#include <nsIObjectInputStream.h>
#include <nsIObjectOutputStream.h>
#include <nsIProgrammingLanguage.h>
#include <nsIStringEnumerator.h>
#include <nsMemory.h>
#include <nsServiceManagerUtils.h>
#include <sbTArrayStringEnumerator.h>
#include <sbStringUtils.h>
Include dependency graph for sbLibraryConstraints.cpp:

Go to the source code of this file.

Functions

 NS_IMPL_ISUPPORTS1 (sbLibraryConstraintBuilder, sbILibraryConstraintBuilder) static inline nsresult CheckStringAndSkip(const nsAString &aSource
 
static NS_DEFINE_CID (kLibraryConstraintCID,{0x318e7d66, 0x59c4, 0x43d5,{0x8c, 0xf6, 0x5a, 0x51, 0x26, 0x3d, 0xb5, 0xd6}})
 
 NS_IMPL_ISUPPORTS3 (sbLibraryConstraint, sbILibraryConstraint, nsISerializable, nsIClassInfo) NS_IMPL_CI_INTERFACE_GETTER3(sbLibraryConstraint
 
 NS_IMPL_ISUPPORTS1 (sbLibraryConstraintGroup, sbILibraryConstraintGroup) sbLibraryConstraintGroup
 
static NS_DEFINE_CID (kLibrarySortCID,{0xac85b1e9, 0xc3e1, 0x456a,{0xaf, 0x0f, 0x41, 0x61, 0xd3, 0x69, 0x38, 0xdf}})
 
 NS_IMPL_ISUPPORTS3 (sbLibrarySort, sbILibrarySort, nsISerializable, nsIClassInfo) NS_IMPL_CI_INTERFACE_GETTER3(sbLibrarySort
 

Variables

PRUint32 & offset
 
PRUint32 const nsAString & aSubstring
 
return NS_OK
 
 sbILibraryConstraint
 
 nsISerializable
 
 sbILibrarySort
 

Function Documentation

static NS_DEFINE_CID ( kLibraryConstraintCID  ,
{0x318e7d66, 0x59c4, 0x43d5,{0x8c, 0xf6, 0x5a, 0x51, 0x26, 0x3d, 0xb5, 0xd6}}   
)
static
static NS_DEFINE_CID ( kLibrarySortCID  ,
{0xac85b1e9, 0xc3e1, 0x456a,{0xaf, 0x0f, 0x41, 0x61, 0xd3, 0x69, 0x38, 0xdf}}   
)
static
NS_IMPL_ISUPPORTS1 ( sbLibraryConstraintBuilder  ,
sbILibraryConstraintBuilder   
) const

== Constraint / Constraint Group String Serialization Format ==

Whitespace is significant in the constraint serialization format.

The constraint serialization is a JSON-style array, constraint := '[' constraint-group ( ', ' constraint-group )* ']'

The constraint group serialzation is a JSON-style object, constraint-group := '{' constraint-entry ( ', ' constraint-entry )* '}' constraint-entry := '"' property-name '": ' property-values

The property name is assumed to not contain quotation mark characters (which are invalid in URIs). Any other characters are taken literally; this may result in invalid property names being used if the input is not correct. See sbIPropertyManager and sbStandardProperties.h.

The property values serialization is a JSON-style string array, property-values := '[' '"' escaped-value '"' ( ', "' escaped-value '"' )* ']' where escaped-value is the value of the constraint, as escaped via nsINetUtils::escapeString() with nsINetUtils::ESCAPE_XALPHAS on the UTF-8 encoding of the string.

Sample (standard) constraint: [{"http://songbirdnest.com/data/1.0#isList": ["0"]}, {"http://songbirdnest.com/data/1.0#hidden": ["0"]}]

Sample constraint with escaped value: [{"http://songbirdnest.com/data/1.0#genre": ["%E6%B8%AC%20%E8%A9%A6"]}]

NS_IMPL_ISUPPORTS1 ( sbLibraryConstraintGroup  ,
sbILibraryConstraintGroup   
)

Definition at line 664 of file sbLibraryConstraints.cpp.

NS_IMPL_ISUPPORTS3 ( sbLibraryConstraint  ,
sbILibraryConstraint  ,
nsISerializable  ,
nsIClassInfo   
)
NS_IMPL_ISUPPORTS3 ( sbLibrarySort  ,
sbILibrarySort  ,
nsISerializable  ,
nsIClassInfo   
)

Variable Documentation

PRUint32 const nsAString& aSubstring
Initial value:
{
if (!Substring(aSource, offset, aSubstring.Length()).Equals(aSubstring)) {
return NS_ERROR_ILLEGAL_VALUE;
}
offset += aSubstring.Length()
PRUint32 const nsAString & aSubstring
PRUint32 & offset

Definition at line 85 of file sbLibraryConstraints.cpp.

return NS_OK

Definition at line 90 of file sbLibraryConstraints.cpp.

nsISerializable

Definition at line 382 of file sbLibraryConstraints.cpp.

_adjustDate offset

Definition at line 83 of file sbLibraryConstraints.cpp.

Definition at line 382 of file sbLibraryConstraints.cpp.

Definition at line 976 of file sbLibraryConstraints.cpp.