コード例 #1
0
ファイル: Protocol.cpp プロジェクト: SummerSnail2014/haiku
status_t
Protocol::GetQuota(uint64& used, uint64& total)
{
	if (!Capabilities().Contains("QUOTA"))
		return B_ERROR;

	GetQuotaCommand quotaCommand;
	status_t status = ProcessCommand(quotaCommand);
	if (status != B_OK)
		return status;

	used = quotaCommand.UsedStorage();
	total = quotaCommand.TotalStorage();
	return B_OK;
}
コード例 #2
0
ファイル: IMAPFolders.cpp プロジェクト: DonCN/haiku
status_t
IMAPFolders::GetQuota(uint64& used, uint64& total)
{
	if (fCapabilityHandler.Capabilities() == "")
		ProcessCommand(fCapabilityHandler.Command());
	if (fCapabilityHandler.Capabilities().FindFirst("QUOTA") < 0)
		return B_ERROR;

	GetQuotaCommand quotaCommand;
	status_t status = ProcessCommand(&quotaCommand);
	if (status != B_OK)
		return status;

	used = quotaCommand.UsedStorage();
	total = quotaCommand.TotalStorage();
	return B_OK;
}