From 0f1762f547c2f67b47e4cf201701335433528a10 Mon Sep 17 00:00:00 2001 From: Birunthan Mohanathas Date: Fri, 29 Aug 2014 13:38:45 -0700 Subject: [PATCH] Bug 1058669 - Expand NS_IMPL_GETSET macro in nsDirIndex. r=mayhemer --- netwerk/streamconv/converters/nsDirIndex.cpp | 55 ++++++++++++++++++-- 1 file changed, 50 insertions(+), 5 deletions(-) diff --git a/netwerk/streamconv/converters/nsDirIndex.cpp b/netwerk/streamconv/converters/nsDirIndex.cpp index c0fbaba15e9b..8729cf208120 100644 --- a/netwerk/streamconv/converters/nsDirIndex.cpp +++ b/netwerk/streamconv/converters/nsDirIndex.cpp @@ -4,7 +4,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsDirIndex.h" -#include "nsISupportsObsolete.h" NS_IMPL_ISUPPORTS(nsDirIndex, nsIDirIndex) @@ -16,9 +15,23 @@ nsDirIndex::nsDirIndex() : mType(TYPE_UNKNOWN), nsDirIndex::~nsDirIndex() {} -NS_IMPL_GETSET(nsDirIndex, Type, uint32_t, mType) +NS_IMETHODIMP +nsDirIndex::GetType(uint32_t* aType) +{ + if (!aType) { + return NS_ERROR_NULL_POINTER; + } -// GETSET macros for modern strings would be nice... + *aType = mType; + return NS_OK; +} + +NS_IMETHODIMP +nsDirIndex::SetType(uint32_t aType) +{ + mType = aType; + return NS_OK; +} NS_IMETHODIMP nsDirIndex::GetContentType(char* *aContentType) { @@ -65,6 +78,38 @@ nsDirIndex::SetDescription(const char16_t* aDescription) { return NS_OK; } -NS_IMPL_GETSET(nsDirIndex, Size, int64_t, mSize) -NS_IMPL_GETSET(nsDirIndex, LastModified, PRTime, mLastModified) +NS_IMETHODIMP +nsDirIndex::GetSize(int64_t* aSize) +{ + if (!aSize) { + return NS_ERROR_NULL_POINTER; + } + *aSize = mSize; + return NS_OK; +} + +NS_IMETHODIMP +nsDirIndex::SetSize(int64_t aSize) +{ + mSize = aSize; + return NS_OK; +} + +NS_IMETHODIMP +nsDirIndex::GetLastModified(PRTime* aLastModified) +{ + if (!aLastModified) { + return NS_ERROR_NULL_POINTER; + } + + *aLastModified = mLastModified; + return NS_OK; +} + +NS_IMETHODIMP +nsDirIndex::SetLastModified(PRTime aLastModified) +{ + mLastModified = aLastModified; + return NS_OK; +}