jinglefiletransfer.h
/*
Copyright (c) 2013-2023 by Jakob Schröter <js@camaya.net>
This file is part of the gloox library. http://camaya.net/gloox
This software is distributed under a license. The full license
agreement can be found in the file LICENSE in this distribution.
This software may not be copied, modified, sold or distributed
other than expressed in the named license agreement.
This software is distributed without any warranty.
*/
#ifndef JINGLEFILETRANSFER_H__
#define JINGLEFILETRANSFER_H__
#include "jingleplugin.h"
#include "tag.h"
#include <string>
#include <list>
namespace gloox
{
namespace Jingle
{
class GLOOX_API FileTransfer : public Plugin
{
public:
enum Type
{
Offer,
Request,
Checksum,
Abort,
Received,
Invalid
};
struct File
{
std::string name;
std::string date;
std::string desc;
std::string hash;
std::string hash_algo;
long int size;
bool range;
long int offset;
};
typedef std::list<File> FileList;
FileTransfer( Type type, const FileList& files );
FileTransfer( const Tag* tag = 0 );
virtual ~FileTransfer() {}
Type type() const { return m_type; }
const FileList& files() const { return m_files; }
// reimplemented from Plugin
virtual const StringList features() const;
// reimplemented from Plugin
virtual const std::string& filterString() const;
// reimplemented from Plugin
virtual Tag* tag() const;
// reimplemented from Plugin
virtual Plugin* newInstance( const Tag* tag ) const;
// reimplemented from Plugin
virtual Plugin* clone() const
{
return new FileTransfer( *this );
}
private:
void parseFileList( const TagList& files );
Type m_type;
FileList m_files;
};
}
}
#endif // JINGLEFILETRANSFER_H__
gloox::Jingle::FileTransfer::Type
Type
Definition jinglefiletransfer.h:45
gloox::Jingle::FileTransfer::Received
@ Received
Definition jinglefiletransfer.h:50
gloox::Jingle::FileTransfer::Abort
@ Abort
Definition jinglefiletransfer.h:49
gloox::Jingle::FileTransfer::Offer
@ Offer
Definition jinglefiletransfer.h:46
gloox::Jingle::FileTransfer::Checksum
@ Checksum
Definition jinglefiletransfer.h:48
gloox::Jingle::FileTransfer::Invalid
@ Invalid
Definition jinglefiletransfer.h:51
gloox::Jingle::FileTransfer::Request
@ Request
Definition jinglefiletransfer.h:47
gloox::Jingle::FileTransfer::clone
virtual Plugin * clone() const
Definition jinglefiletransfer.h:116
gloox::Jingle::FileTransfer::FileList
std::list< File > FileList
Definition jinglefiletransfer.h:70
gloox::Jingle::FileTransfer::FileTransfer
FileTransfer(Type type, const FileList &files)
Definition jinglefiletransfer.cpp:36
gloox::Jingle::FileTransfer::files
const FileList & files() const
Definition jinglefiletransfer.h:101
gloox::Jingle::FileTransfer::~FileTransfer
virtual ~FileTransfer()
Definition jinglefiletransfer.h:89
gloox::Jingle::FileTransfer::type
Type type() const
Definition jinglefiletransfer.h:95
gloox::Jingle::FileTransfer::tag
virtual Tag * tag() const
Definition jinglefiletransfer.cpp:116
gloox::Jingle::Plugin
An abstraction of a Jingle plugin. This is part of Jingle (XEP-0166 et al.).
Definition jingleplugin.h:68
gloox::Jingle::Plugin::Plugin
Plugin(JinglePluginType type)
Definition jingleplugin.h:76
gloox::Tag
This is an abstraction of an XML element.
Definition tag.h:47
gloox::Jingle
The namespace containing Jingle-related (XEP-0166 et. al.) classes.
Definition jinglecontent.cpp:22
gloox
The namespace for the gloox library.
Definition adhoc.cpp:28
gloox::TagList
std::list< Tag * > TagList
Definition tag.h:31
gloox::StringList
std::list< std::string > StringList
Definition gloox.h:1251
gloox::Jingle::FileTransfer::File
Definition jinglefiletransfer.h:58
gloox::Jingle::FileTransfer::File::desc
std::string desc
Definition jinglefiletransfer.h:61
gloox::Jingle::FileTransfer::File::hash_algo
std::string hash_algo
Definition jinglefiletransfer.h:63
gloox::Jingle::FileTransfer::File::range
bool range
Definition jinglefiletransfer.h:65
gloox::Jingle::FileTransfer::File::hash
std::string hash
Definition jinglefiletransfer.h:62
gloox::Jingle::FileTransfer::File::date
std::string date
Definition jinglefiletransfer.h:60
gloox::Jingle::FileTransfer::File::name
std::string name
Definition jinglefiletransfer.h:59
gloox::Jingle::FileTransfer::File::size
long int size
Definition jinglefiletransfer.h:64
gloox::Jingle::FileTransfer::File::offset
long int offset
Definition jinglefiletransfer.h:66