FolderItemParser.h
/*
* This file is part of buteo-sync-plugins package
*
* Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
*
* Contact: Sateesh Kavuri <sateesh.kavuri@nokia.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef FOLDERITEMPARSER_H
#define FOLDERITEMPARSER_H
#include <QString>
#include <QDateTime>
class FolderItemParser
{
public:
static const QString FOLDER_MIME_TYPE;
struct FolderData {
QString iName;
QDateTime iCreated;
QDateTime iModified;
};
static bool readFolderData(const QByteArray &aRawData, FolderData &aFolderData);
static QByteArray writeFolderData(const FolderData &aFolderData);
private:
static QDateTime parseDateTime(const QString &aDateTime);
static QString encodeDateTime(const QDateTime &aDateTime);
friend class FolderItemParserTest;
};
#endif
FolderItemParser
Reads and writes data in application/vnd.omads-folder+xml format.
Definition FolderItemParser.h:33
FolderItemParser::FOLDER_MIME_TYPE
static const QString FOLDER_MIME_TYPE
Folder item MIME type.
Definition FolderItemParser.h:37
FolderItemParser::readFolderData
static bool readFolderData(const QByteArray &aRawData, FolderData &aFolderData)
Parses folder data from the provided byte array.
FolderItemParser::writeFolderData
static QByteArray writeFolderData(const FolderData &aFolderData)
Writes folder data to a byte array.
FolderItemParser::FolderData
Structure for storing folder data.
Definition FolderItemParser.h:40
FolderItemParser::FolderData::iModified
QDateTime iModified
Modified Time.
Definition FolderItemParser.h:46
FolderItemParser::FolderData::iCreated
QDateTime iCreated
Created Time.
Definition FolderItemParser.h:44
FolderItemParser::FolderData::iName
QString iName
Name of the folder.
Definition FolderItemParser.h:42