netwerk/streamconv/converters/nsDirIndex.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/streamconv/converters/nsDirIndex.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,70 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsDirIndex.h"
    1.10 +#include "nsISupportsObsolete.h"
    1.11 +
    1.12 +NS_IMPL_ISUPPORTS(nsDirIndex,
    1.13 +                  nsIDirIndex)
    1.14 +
    1.15 +nsDirIndex::nsDirIndex() : mType(TYPE_UNKNOWN),
    1.16 +                           mSize(UINT64_MAX),
    1.17 +                           mLastModified(-1) {
    1.18 +}
    1.19 +
    1.20 +nsDirIndex::~nsDirIndex() {}
    1.21 +
    1.22 +NS_IMPL_GETSET(nsDirIndex, Type, uint32_t, mType)
    1.23 +
    1.24 +// GETSET macros for modern strings would be nice...
    1.25 +
    1.26 +NS_IMETHODIMP
    1.27 +nsDirIndex::GetContentType(char* *aContentType) {
    1.28 +  *aContentType = ToNewCString(mContentType);
    1.29 +  if (!*aContentType)
    1.30 +    return NS_ERROR_OUT_OF_MEMORY;
    1.31 +
    1.32 +  return NS_OK;
    1.33 +}
    1.34 +
    1.35 +NS_IMETHODIMP
    1.36 +nsDirIndex::SetContentType(const char* aContentType) {
    1.37 +  mContentType = aContentType;
    1.38 +  return NS_OK;
    1.39 +}
    1.40 +
    1.41 +NS_IMETHODIMP
    1.42 +nsDirIndex::GetLocation(char* *aLocation) {
    1.43 +  *aLocation = ToNewCString(mLocation);
    1.44 +  if (!*aLocation)
    1.45 +    return NS_ERROR_OUT_OF_MEMORY;
    1.46 +
    1.47 +  return NS_OK;
    1.48 +}
    1.49 +
    1.50 +NS_IMETHODIMP
    1.51 +nsDirIndex::SetLocation(const char* aLocation) {
    1.52 +  mLocation = aLocation;
    1.53 +  return NS_OK;
    1.54 +}
    1.55 +
    1.56 +NS_IMETHODIMP
    1.57 +nsDirIndex::GetDescription(char16_t* *aDescription) {
    1.58 +  *aDescription = ToNewUnicode(mDescription);
    1.59 +  if (!*aDescription)
    1.60 +    return NS_ERROR_OUT_OF_MEMORY;
    1.61 +
    1.62 +  return NS_OK;
    1.63 +}
    1.64 +
    1.65 +NS_IMETHODIMP
    1.66 +nsDirIndex::SetDescription(const char16_t* aDescription) {
    1.67 +  mDescription.Assign(aDescription);
    1.68 +  return NS_OK;
    1.69 +}
    1.70 +
    1.71 +NS_IMPL_GETSET(nsDirIndex, Size, int64_t, mSize)
    1.72 +NS_IMPL_GETSET(nsDirIndex, LastModified, PRTime, mLastModified)
    1.73 +

mercurial