コード例 #1
0
void
GPrefsMgr::GetUIDList
	(
	JPtrArray<JString>& list
	)
{
	if (IDValid(kGUIDListID))
		{
		std::string data;
		const JBoolean ok = GetData(kGUIDListID, &data);
		assert( ok );

		std::istringstream dataStream(data);

		JSize count;
		dataStream >> count;

		list.SetCompareFunction(JCompareStringsCaseSensitive);

		for (JIndex i=1; i<=count; i++)
			{
			JString* str = new JString;
			assert( str != NULL );
			dataStream >> *str;
			if (!list.InsertSorted(str, kJFalse))
				{
				delete str;
				}
			}
		}
}
コード例 #2
0
void
GPrefsMgr::GetInboxes
	(
	JPtrArray<JString>& inboxes
	)
{
	if (IDValid(kGInboxesID))
		{
		std::string data;
		const JBoolean ok = GetData(kGInboxesID, &data);
		assert( ok );

		std::istringstream dataStream(data);

		JSize count;
		dataStream >> count;

		inboxes.SetCompareFunction(CompareFileNames);

		for (JIndex i=1; i<=count; i++)
			{
			JString* str = new JString;
			assert( str != NULL );
			dataStream >> *str;
			if (!inboxes.InsertSorted(str, kJFalse))
				{
				delete str;
				}
			}
		}
}