30 #include <nsAutoPtr.h>
31 #include <nsArrayEnumerator.h>
32 #include <nsCOMArray.h>
33 #include <nsIClassInfoImpl.h>
34 #include <nsINetUtil.h>
35 #include <nsIObjectInputStream.h>
36 #include <nsIObjectOutputStream.h>
37 #include <nsIProgrammingLanguage.h>
38 #include <nsIStringEnumerator.h>
40 #include <nsServiceManagerUtils.h>
82 static inline nsresult CheckStringAndSkip(const nsAString & aSource,
86 if (!Substring(aSource, offset, aSubstring.Length()).Equals(aSubstring)) {
87 return NS_ERROR_ILLEGAL_VALUE;
89 offset += aSubstring.Length();
95 sbLibraryConstraintBuilder::ParseFromString(
const nsAString &
aConstraint,
98 NS_ENSURE_ARG_POINTER(_retval);
103 rv = EnsureConstraint();
104 NS_ENSURE_SUCCESS(rv, rv);
107 rv = mConstraint->GetGroupCount(&groupCount);
108 NS_ENSURE_SUCCESS(rv, rv);
110 NS_ENSURE_TRUE(groupCount == 1, NS_ERROR_ALREADY_INITIALIZED);
112 nsCOMPtr<sbILibraryConstraintGroup>
group;
113 rv = mConstraint->GetGroup(0, getter_AddRefs(group));
114 NS_ENSURE_SUCCESS(rv, rv);
116 nsCOMPtr<nsIStringEnumerator> props;
117 rv = group->GetProperties(getter_AddRefs(props));
118 NS_ENSURE_SUCCESS(rv, rv);
121 rv = props->HasMore(&hasMore);
122 NS_ENSURE_SUCCESS(rv, rv);
123 NS_ENSURE_FALSE(hasMore, NS_ERROR_ALREADY_INITIALIZED);
125 nsCOMPtr<nsINetUtil> netUtil =
126 do_GetService(
"@mozilla.org/network/util;1", &rv);
127 NS_ENSURE_SUCCESS(rv, rv);
129 rv = CheckStringAndSkip(aConstraint, offset, NS_LITERAL_STRING(
"[{\""));
130 NS_ENSURE_SUCCESS(rv, rv);
134 next = aConstraint.FindChar(PRUnichar(
'"'), offset);
136 return NS_ERROR_ILLEGAL_VALUE;
139 nsString property(Substring(aConstraint, offset,
next - offset));
143 rv = CheckStringAndSkip(aConstraint, offset, NS_LITERAL_STRING(
": [\""));
144 NS_ENSURE_SUCCESS(rv, rv);
147 NS_ENSURE_TRUE(array, NS_ERROR_OUT_OF_MEMORY);
151 next = aConstraint.FindChar(PRUnichar(
'"'), offset);
153 return NS_ERROR_ILLEGAL_VALUE;
155 nsString
value(Substring(aConstraint, offset,
next - offset));
157 nsCString unescapedValue;
158 rv = netUtil->UnescapeString(NS_ConvertUTF16toUTF8(value),
159 nsINetUtil::ESCAPE_XALPHAS,
161 NS_ENSURE_SUCCESS(rv, rv);
162 nsString* added = array->AppendElement(NS_ConvertUTF8toUTF16(unescapedValue));
163 NS_ENSURE_TRUE(added, NS_ERROR_OUT_OF_MEMORY);
165 if (Substring(aConstraint, offset, 1).EqualsLiteral(
"]")) {
170 rv = CheckStringAndSkip(aConstraint, offset, NS_LITERAL_STRING(
", \""));
171 NS_ENSURE_SUCCESS(rv, rv);
174 rv = mConstraint->AddToCurrent(property, array);
175 NS_ENSURE_SUCCESS(rv, rv);
179 if (Substring(aConstraint, offset).EqualsLiteral(
"}]")) {
183 rv = CheckStringAndSkip(aConstraint, offset, NS_LITERAL_STRING(
"}, {\""));
184 NS_ENSURE_SUCCESS(rv, rv);
185 rv = mConstraint->Intersect();
186 NS_ENSURE_SUCCESS(rv, rv);
189 NS_ENSURE_TRUE(offset == aConstraint.Length() - 2, NS_ERROR_ILLEGAL_VALUE);
191 NS_ADDREF(*_retval =
this);
199 NS_ENSURE_ARG_POINTER(aConstraint);
202 rv = EnsureConstraint();
203 NS_ENSURE_SUCCESS(rv, rv);
206 rv = aConstraint->GetGroupCount(&groupCount);
207 NS_ENSURE_SUCCESS(rv, rv);
209 for (PRUint32
i = 0;
i < groupCount;
i++) {
210 nsCOMPtr<sbILibraryConstraintGroup>
group;
211 rv = aConstraint->GetGroup(
i, getter_AddRefs(group));
212 NS_ENSURE_SUCCESS(rv, rv);
214 nsCOMPtr<nsIStringEnumerator> properties;
215 rv = group->GetProperties(getter_AddRefs(properties));
216 NS_ENSURE_SUCCESS(rv, rv);
219 while (NS_SUCCEEDED(properties->HasMore(&hasMore)) && hasMore) {
221 rv = properties->GetNext(property);
222 NS_ENSURE_SUCCESS(rv, rv);
224 nsCOMPtr<nsIStringEnumerator> values;
225 rv = group->GetValues(property, getter_AddRefs(values));
226 NS_ENSURE_SUCCESS(rv, rv);
228 rv = IncludeList(property, values, nsnull);
229 NS_ENSURE_SUCCESS(rv, rv);
232 if (
i + 1 < groupCount) {
233 rv = Intersect(nsnull);
234 NS_ENSURE_SUCCESS(rv, rv);
240 NS_ADDREF(*_retval =
this);
247 sbLibraryConstraintBuilder::Include(
const nsAString& aProperty,
251 NS_ENSURE_ARG(!aProperty.IsEmpty());
255 rv = EnsureConstraint();
256 NS_ENSURE_SUCCESS(rv, rv);
260 NS_ENSURE_TRUE(
array, NS_ERROR_OUT_OF_MEMORY);
262 nsString* success =
array->AppendElement(aValue);
263 NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY);
266 rv = mConstraint->AddToCurrent(aProperty,
array.forget());
267 NS_ENSURE_SUCCESS(rv, rv);
270 NS_ADDREF(*_retval =
this);
277 sbLibraryConstraintBuilder::IncludeList(
const nsAString& aProperty,
281 NS_ENSURE_ARG(!aProperty.IsEmpty());
285 rv = EnsureConstraint();
286 NS_ENSURE_SUCCESS(rv, rv);
290 NS_ENSURE_TRUE(
array, NS_ERROR_OUT_OF_MEMORY);
293 while (NS_SUCCEEDED(aValues->HasMore(&hasMore)) && hasMore) {
295 rv = aValues->GetNext(value);
296 NS_ENSURE_SUCCESS(rv, rv);
298 nsString* success =
array->AppendElement(value);
299 NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY);
303 rv = mConstraint->AddToCurrent(aProperty,
array.forget());
304 NS_ENSURE_SUCCESS(rv, rv);
307 NS_ADDREF(*_retval =
this);
318 rv = EnsureConstraint();
319 NS_ENSURE_SUCCESS(rv, rv);
321 NS_ENSURE_STATE(mConstraint->IsValid());
323 rv = mConstraint->Intersect();
324 NS_ENSURE_SUCCESS(rv, rv);
327 NS_ADDREF(*_retval =
this);
336 NS_ENSURE_ARG_POINTER(_retval);
340 rv = EnsureConstraint();
341 NS_ENSURE_SUCCESS(rv, rv);
343 NS_ENSURE_STATE(mConstraint->IsValid());
345 NS_ADDREF(*_retval = mConstraint);
346 mConstraint = nsnull;
352 sbLibraryConstraintBuilder::EnsureConstraint()
359 NS_ENSURE_TRUE(constraint, NS_ERROR_OUT_OF_MEMORY);
361 nsresult rv = constraint->Init();
362 NS_ENSURE_SUCCESS(rv, rv);
364 mConstraint = constraint;
386 sbLibraryConstraint::sbLibraryConstraint() :
392 sbLibraryConstraint::GetGroupCount(PRUint32* aGroupCount)
394 NS_ENSURE_STATE(mInitialized);
395 NS_ENSURE_ARG_POINTER(aGroupCount);
397 *aGroupCount = mConstraint.Length();
405 NS_ENSURE_STATE(mInitialized);
406 NS_ENSURE_ARG_POINTER(aGroups);
408 nsCOMArray<sbILibraryConstraintGroup>
array;
409 PRUint32 length = mConstraint.Length();
410 for (PRUint32
i = 0;
i < length;
i++) {
411 PRBool success = array.AppendObject(mConstraint[
i]);
412 NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY);
415 nsresult rv = NS_NewArrayEnumerator(aGroups, array);
416 NS_ENSURE_SUCCESS(rv, rv);
421 sbLibraryConstraint::GetGroup(PRUint32 aIndex,
424 NS_ENSURE_STATE(mInitialized);
425 NS_ENSURE_ARG_POINTER(_retval);
426 NS_ENSURE_TRUE(aIndex < mConstraint.Length(), NS_ERROR_INVALID_ARG);
428 NS_ADDREF(*_retval = mConstraint[aIndex]);
436 NS_ENSURE_STATE(mInitialized);
437 NS_ENSURE_ARG_POINTER(_retval);
441 if (!aOtherConstraint) {
447 rv = aOtherConstraint->GetGroupCount(&groupCount);
448 NS_ENSURE_SUCCESS(rv, rv);
455 nsCOMArray<sbILibraryConstraintGroup> matchesRemaining(groupCount);
458 nsCOMPtr<sbILibraryConstraintGroup> otherGroup;
459 rv = aOtherConstraint->GetGroup(
i, getter_AddRefs(otherGroup));
460 NS_ENSURE_SUCCESS(rv, rv);
462 PRBool success = matchesRemaining.AppendObject(otherGroup);
463 NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY);
467 for (PRInt32 j = 0; j < matchesRemaining.Count(); j++) {
469 rv = mConstraint[
i]->Equals(matchesRemaining[j], &equals);
470 NS_ENSURE_SUCCESS(rv, rv);
473 matchesRemaining.RemoveObjectAt(j);
478 *_retval = matchesRemaining.Count() == 0;
485 NS_ENSURE_STATE(mInitialized);
488 buff.AssignLiteral(
"[");
490 PRUint32 length = mConstraint.Length();
491 for (PRUint32
i = 0;
i < length;
i++) {
494 nsresult rv = mConstraint[
i]->ToString(temp);
495 NS_ENSURE_SUCCESS(rv, rv);
498 if (
i + 1 < length) {
499 buff.AppendLiteral(
", ");
504 buff.AppendLiteral(
"]");
511 sbLibraryConstraint::Read(nsIObjectInputStream* aStream)
513 NS_ENSURE_STATE(!mInitialized);
514 NS_ENSURE_ARG_POINTER(aStream);
519 rv = aStream->Read32(&length);
520 NS_ENSURE_SUCCESS(rv, rv);
522 for (PRUint32
i = 0;
i < length;
i++) {
524 NS_ENSURE_TRUE(group, NS_ERROR_OUT_OF_MEMORY);
526 nsresult rv = group->Read(aStream);
527 NS_ENSURE_SUCCESS(rv, rv);
530 NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY);
533 mInitialized = PR_TRUE;
539 sbLibraryConstraint::Write(nsIObjectOutputStream* aStream)
541 NS_ENSURE_STATE(mInitialized);
542 NS_ENSURE_ARG_POINTER(aStream);
546 PRUint32 length = mConstraint.Length();
547 rv = aStream->Write32(length);
548 NS_ENSURE_SUCCESS(rv, rv);
550 for (PRUint32
i = 0;
i < length;
i++) {
551 rv = mConstraint[
i]->Write(aStream);
552 NS_ENSURE_SUCCESS(rv, rv);
560 sbLibraryConstraint::GetInterfaces(PRUint32*
count, nsIID*** array)
566 sbLibraryConstraint::GetHelperForLanguage(PRUint32
language,
574 sbLibraryConstraint::GetContractID(
char** aContractID)
576 *aContractID = nsnull;
581 sbLibraryConstraint::GetClassDescription(
char** aClassDescription)
583 *aClassDescription = nsnull;
588 sbLibraryConstraint::GetClassID(nsCID** aClassID)
595 sbLibraryConstraint::GetImplementationLanguage(PRUint32* aImplementationLanguage)
597 *aImplementationLanguage = nsIProgrammingLanguage::CPLUSPLUS;
602 sbLibraryConstraint::GetFlags(PRUint32* aFlags)
609 sbLibraryConstraint::GetClassIDNoAlloc(nsCID* aClassIDNoAlloc)
611 NS_ENSURE_ARG_POINTER(aClassIDNoAlloc);
612 *aClassIDNoAlloc = kLibraryConstraintCID;
617 sbLibraryConstraint::Init()
619 mInitialized = PR_TRUE;
624 sbLibraryConstraint::Intersect()
627 NS_ENSURE_TRUE(group, NS_ERROR_OUT_OF_MEMORY);
629 nsresult rv = group->Init();
630 NS_ENSURE_SUCCESS(rv, rv);
633 NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY);
639 sbLibraryConstraint::AddToCurrent(
const nsAString& aProperty,
642 PRUint32 length = mConstraint.Length();
643 NS_ENSURE_TRUE(length, NS_ERROR_UNEXPECTED);
645 nsresult rv = mConstraint[length - 1]->Add(aProperty, aArray);
646 NS_ENSURE_SUCCESS(rv, rv);
652 sbLibraryConstraint::IsValid()
654 PRUint32 length = mConstraint.Length();
655 NS_ENSURE_TRUE(length, NS_ERROR_UNEXPECTED);
657 return !mConstraint[length - 1]->IsEmpty();
672 PLDHashOperator PR_CALLBACK
673 sbLibraryConstraintGroup::AddKeysToArrayCallback(nsStringHashKey::KeyType aKey,
677 NS_ASSERTION(aEntry,
"Null entry in the hash?!");
680 NS_ASSERTION(array,
"null userdata");
682 nsString* success = array->AppendElement(aKey);
683 NS_ENSURE_TRUE(success, PL_DHASH_STOP);
685 return PL_DHASH_NEXT;
691 NS_ENSURE_STATE(mInitialized);
692 NS_ENSURE_ARG_POINTER(aProperties);
694 nsAutoTArray<nsString, 10>
array;
695 mConstraintGroup.EnumerateRead(AddKeysToArrayCallback, &array);
696 nsCOMPtr<nsIStringEnumerator> enumerator =
698 NS_ENSURE_TRUE(enumerator, NS_ERROR_OUT_OF_MEMORY);
700 enumerator.forget(aProperties);
706 sbLibraryConstraintGroup::GetValues(
const nsAString& aProperty,
709 NS_ENSURE_STATE(mInitialized);
710 NS_ENSURE_ARG_POINTER(_retval);
713 if (!mConstraintGroup.Get(aProperty, &array)) {
714 return NS_ERROR_NOT_AVAILABLE;
717 nsCOMPtr<nsIStringEnumerator> enumerator =
719 NS_ENSURE_TRUE(enumerator, NS_ERROR_OUT_OF_MEMORY);
721 enumerator.forget(_retval);
727 sbLibraryConstraintGroup::HasProperty(
const nsAString& aProperty,
730 NS_ENSURE_STATE(mInitialized);
731 NS_ENSURE_ARG_POINTER(_retval);
733 *_retval = mConstraintGroup.Get(aProperty, nsnull);
742 NS_ENSURE_STATE(mInitialized);
743 NS_ENSURE_ARG_POINTER(_retval);
753 rv = GetProperties(getter_AddRefs(properties));
754 NS_ENSURE_SUCCESS(rv, rv);
756 nsCOMPtr<nsIStringEnumerator> otherProperties;
757 rv = aOtherGroup->GetProperties(getter_AddRefs(otherProperties));
758 NS_ENSURE_SUCCESS(rv, rv);
762 NS_ENSURE_SUCCESS(rv, rv);
769 mConstraintGroup.EnumerateRead(AddKeysToArrayCallback, &propertyArray);
770 PRUint32 propertyCount = propertyArray.Length();
771 NS_ENSURE_TRUE(propertyCount == mConstraintGroup.Count(),
772 NS_ERROR_UNEXPECTED);
774 for (PRUint32
i = 0;
i < propertyCount;
i++) {
776 nsCOMPtr<nsIStringEnumerator> values;
777 rv = GetValues(propertyArray[
i], getter_AddRefs(values));
778 NS_ENSURE_SUCCESS(rv, rv);
780 nsCOMPtr<nsIStringEnumerator> otherValues;
781 rv = aOtherGroup->GetValues(propertyArray[i], getter_AddRefs(otherValues));
782 NS_ENSURE_SUCCESS(rv, rv);
785 NS_ENSURE_SUCCESS(rv, rv);
799 NS_ENSURE_STATE(mInitialized);
800 nsString buff(NS_LITERAL_STRING(
"{"));
805 mConstraintGroup.EnumerateRead(AddKeysToArrayCallback, &properties);
807 nsCOMPtr<nsINetUtil> netUtil =
808 do_GetService(
"@mozilla.org/network/util;1", &rv);
809 NS_ENSURE_SUCCESS(rv, rv);
811 PRUint32 propertyCount = properties.Length();
812 for (PRUint32 i = 0; i < propertyCount; i++) {
813 buff.AppendLiteral(
"\"");
814 buff.Append(properties[i]);
815 buff.AppendLiteral(
"\": [");
817 PRBool success = mConstraintGroup.Get(properties[i], &values);
818 NS_ENSURE_SUCCESS(success, NS_ERROR_UNEXPECTED);
819 PRUint32 valueCount = values->Length();
820 for (PRUint32 j = 0; j < valueCount; j++) {
821 buff.AppendLiteral(
"\"");
823 rv = netUtil->EscapeString(NS_ConvertUTF16toUTF8(values->ElementAt(j)),
824 nsINetUtil::ESCAPE_XALPHAS,
826 NS_ENSURE_SUCCESS(rv, rv);
827 buff.Append(NS_ConvertUTF8toUTF16(cbuff));
828 buff.AppendLiteral(
"\"");
830 if (j + 1 < valueCount) {
831 buff.AppendLiteral(
", ");
834 buff.AppendLiteral(
"]");
836 if (i + 1 < propertyCount) {
837 buff.AppendLiteral(
", ");
841 buff.AppendLiteral(
"}");
848 sbLibraryConstraintGroup::Init()
850 PRBool success = mConstraintGroup.Init();
851 NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY);
853 mInitialized = PR_TRUE;
859 sbLibraryConstraintGroup::IsEmpty()
861 return mConstraintGroup.Count() == 0;
865 sbLibraryConstraintGroup::Add(
const nsAString& aProperty,
868 NS_ASSERTION(aArray,
"sbStringArray is null");
869 nsAutoPtr<sbStringArray>
array(aArray);
872 if (mConstraintGroup.Get(aProperty, &existing)) {
873 nsString* success = existing->AppendElements(*array);
874 NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY);
879 PRBool success = mConstraintGroup.Put(aProperty, array);
880 NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY);
890 sbLibraryConstraintGroup::Read(nsIObjectInputStream* aStream)
892 NS_ENSURE_STATE(!mInitialized);
893 NS_ASSERTION(aStream,
"aStream is null");
898 NS_ENSURE_SUCCESS(rv, rv);
901 rv = aStream->Read32(&length);
902 NS_ENSURE_SUCCESS(rv, rv);
904 for (PRUint32 i = 0; i < length; i++) {
906 rv = aStream->ReadString(property);
907 NS_ENSURE_SUCCESS(rv, rv);
910 rv = aStream->Read32(&valueCount);
911 NS_ENSURE_SUCCESS(rv, rv);
914 NS_ENSURE_TRUE(array, NS_ERROR_OUT_OF_MEMORY);
916 for (PRUint32 j = 0; j < valueCount; j++) {
918 rv = aStream->ReadString(value);
919 NS_ENSURE_SUCCESS(rv, rv);
921 nsString* added = array->AppendElement(value);
922 NS_ENSURE_TRUE(added, NS_ERROR_OUT_OF_MEMORY);
925 PRBool success = mConstraintGroup.Put(property, array);
926 NS_ENSURE_TRUE(success, NS_ERROR_OUT_OF_MEMORY);
933 sbLibraryConstraintGroup::Write(nsIObjectOutputStream* aStream)
935 NS_ENSURE_STATE(mInitialized);
936 NS_ASSERTION(aStream,
"aStream is null");
939 nsAutoTArray<nsString, 10>
array;
940 mConstraintGroup.EnumerateRead(AddKeysToArrayCallback, &array);
942 PRUint32 length = array.Length();
943 rv = aStream->Write32(length);
944 NS_ENSURE_SUCCESS(rv, rv);
946 for (PRUint32 i = 0; i < length; i++) {
947 rv = aStream->WriteWStringZ(array[i].BeginReading());
948 NS_ENSURE_SUCCESS(rv, rv);
951 PRBool success = mConstraintGroup.Get(array[i], &values);
952 NS_ENSURE_SUCCESS(success, NS_ERROR_UNEXPECTED);
954 PRUint32 valueCount = values->Length();
955 rv = aStream->Write32(valueCount);
956 NS_ENSURE_SUCCESS(rv, rv);
958 for (PRUint32 j = 0; j < valueCount; j++) {
959 rv = aStream->WriteWStringZ(values->ElementAt(j).BeginReading());
960 NS_ENSURE_SUCCESS(rv, rv);
980 sbLibrarySort::sbLibrarySort() :
982 mIsAscending(PR_FALSE)
989 NS_ENSURE_STATE(!mInitialized);
990 mProperty = aProperty;
991 mIsAscending = aIsAscending;
992 mInitialized = PR_TRUE;
999 NS_ENSURE_STATE(mInitialized);
1000 aProperty = mProperty;
1005 sbLibrarySort::GetIsAscending(PRBool* aIsAscending)
1007 NS_ENSURE_STATE(mInitialized);
1008 NS_ENSURE_ARG_POINTER(aIsAscending);
1010 *aIsAscending = mIsAscending;
1017 NS_ENSURE_STATE(mInitialized);
1020 buff.AssignLiteral(
"sort: property = '");
1021 buff.Append(mProperty);
1022 buff.AppendLiteral(
"' is ascending = ");
1023 buff.AppendLiteral(mIsAscending ?
"yes" :
"no");
1031 sbLibrarySort::Read(nsIObjectInputStream* aStream)
1033 NS_ENSURE_ARG_POINTER(aStream);
1037 rv = aStream->ReadString(mProperty);
1038 NS_ENSURE_SUCCESS(rv, rv);
1040 rv = aStream->ReadBoolean(&mIsAscending);
1041 NS_ENSURE_SUCCESS(rv, rv);
1043 mInitialized = PR_TRUE;
1049 sbLibrarySort::Write(nsIObjectOutputStream* aStream)
1051 NS_ENSURE_STATE(mInitialized);
1052 NS_ENSURE_ARG_POINTER(aStream);
1056 rv = aStream->WriteWStringZ(mProperty.BeginReading());
1057 NS_ENSURE_SUCCESS(rv, rv);
1059 rv = aStream->WriteBoolean(mIsAscending);
1060 NS_ENSURE_SUCCESS(rv, rv);
1067 sbLibrarySort::GetInterfaces(PRUint32*
count, nsIID*** array)
1073 sbLibrarySort::GetHelperForLanguage(PRUint32
language,
1081 sbLibrarySort::GetContractID(
char** aContractID)
1083 *aContractID = nsnull;
1088 sbLibrarySort::GetClassDescription(
char** aClassDescription)
1090 *aClassDescription = nsnull;
1095 sbLibrarySort::GetClassID(nsCID** aClassID)
1102 sbLibrarySort::GetImplementationLanguage(PRUint32* aImplementationLanguage)
1104 *aImplementationLanguage = nsIProgrammingLanguage::CPLUSPLUS;
1109 sbLibrarySort::GetFlags(PRUint32* aFlags)
1116 sbLibrarySort::GetClassIDNoAlloc(nsCID* aClassIDNoAlloc)
1118 NS_ENSURE_ARG_POINTER(aClassIDNoAlloc);
1119 *aClassIDNoAlloc = kLibrarySortCID;
boolean equals(in sbILibraryConstraintGroup aOtherGroup)
nsTArray< nsString > sbStringArray
nsresult SB_StringEnumeratorEquals(nsIStringEnumerator *aLeft, nsIStringEnumerator *aRight, PRBool *_retval)
nsRefPtr< sbLibraryConstraintGroup > sbConstraintGroupRefPtr
PRUint32 const nsAString & aSubstring
#define SONGBIRD_LIBRARY_CONSTRAINT_CID
readonly attribute unsigned long groupCount
static nsresult ToString(const nsDiscriminatedUnion &data, nsACString &outString)
static nsresult GetProperty(nsIPropertyBag2 *aProperties, nsAString const &aProp, nsAString &aValue)
NS_IMPL_ISUPPORTS3(sbLibraryConstraint, sbILibraryConstraint, nsISerializable, nsIClassInfo) NS_IMPL_CI_INTERFACE_GETTER3(sbLibraryConstraint
boolean equals(in sbILibraryConstraint aOtherConstraint)
A sort that can be applied to a media list view.
StringArrayEnumerator prototype hasMore
#define SONGBIRD_LIBRARYSORT_CID
static NS_DEFINE_CID(kLibraryConstraintCID,{0x318e7d66, 0x59c4, 0x43d5,{0x8c, 0xf6, 0x5a, 0x51, 0x26, 0x3d, 0xb5, 0xd6}})
NS_IMPL_ISUPPORTS1(sbLibraryConstraintBuilder, sbILibraryConstraintBuilder) static inline nsresult CheckStringAndSkip(const nsAString &aSource
_getSelectedPageStyle s i
readonly attribute nsIStringEnumerator properties