michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsDirIndex.h" michael@0: #include "nsISupportsObsolete.h" michael@0: michael@0: NS_IMPL_ISUPPORTS(nsDirIndex, michael@0: nsIDirIndex) michael@0: michael@0: nsDirIndex::nsDirIndex() : mType(TYPE_UNKNOWN), michael@0: mSize(UINT64_MAX), michael@0: mLastModified(-1) { michael@0: } michael@0: michael@0: nsDirIndex::~nsDirIndex() {} michael@0: michael@0: NS_IMPL_GETSET(nsDirIndex, Type, uint32_t, mType) michael@0: michael@0: // GETSET macros for modern strings would be nice... michael@0: michael@0: NS_IMETHODIMP michael@0: nsDirIndex::GetContentType(char* *aContentType) { michael@0: *aContentType = ToNewCString(mContentType); michael@0: if (!*aContentType) michael@0: return NS_ERROR_OUT_OF_MEMORY; michael@0: michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: nsDirIndex::SetContentType(const char* aContentType) { michael@0: mContentType = aContentType; michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: nsDirIndex::GetLocation(char* *aLocation) { michael@0: *aLocation = ToNewCString(mLocation); michael@0: if (!*aLocation) michael@0: return NS_ERROR_OUT_OF_MEMORY; michael@0: michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: nsDirIndex::SetLocation(const char* aLocation) { michael@0: mLocation = aLocation; michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: nsDirIndex::GetDescription(char16_t* *aDescription) { michael@0: *aDescription = ToNewUnicode(mDescription); michael@0: if (!*aDescription) michael@0: return NS_ERROR_OUT_OF_MEMORY; michael@0: michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMETHODIMP michael@0: nsDirIndex::SetDescription(const char16_t* aDescription) { michael@0: mDescription.Assign(aDescription); michael@0: return NS_OK; michael@0: } michael@0: michael@0: NS_IMPL_GETSET(nsDirIndex, Size, int64_t, mSize) michael@0: NS_IMPL_GETSET(nsDirIndex, LastModified, PRTime, mLastModified) michael@0: