mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-17 13:30:36 -04:00
added Copy/Paste/Send retroshare//: file urls/links
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1257 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
b7290c67ed
commit
30e4d8d078
12 changed files with 438 additions and 35 deletions
76
retroshare-gui/src/gui/RetroShareLinkAnalyzer.h
Normal file
76
retroshare-gui/src/gui/RetroShareLinkAnalyzer.h
Normal file
|
@ -0,0 +1,76 @@
|
|||
/***************************************************************************
|
||||
* Copyright (C) 2009 *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program 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 General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef RETROSHARE_LINK_ANALYZER
|
||||
#define RETROSHARE_LINK_ANALYZER
|
||||
|
||||
#include <QString>
|
||||
#include <QVector>
|
||||
|
||||
struct RetroShareLinkData
|
||||
{
|
||||
public:
|
||||
RetroShareLinkData () {}
|
||||
RetroShareLinkData (const QString& n, const QString& s, const QString& h)
|
||||
: name (n)
|
||||
, size (s)
|
||||
, hash (h)
|
||||
{}
|
||||
|
||||
const QString& getName () const {return name;}
|
||||
const QString& getSize () const {return size;}
|
||||
const QString& getHash () const {return hash;}
|
||||
|
||||
private:
|
||||
QString name;
|
||||
QString size;
|
||||
QString hash;
|
||||
};
|
||||
|
||||
class RetroShareLinkAnalyzer
|
||||
{
|
||||
public:
|
||||
RetroShareLinkAnalyzer(const QString& url = "");
|
||||
|
||||
void setRetroShareLink(const QString& name, const QString& size, const QString& hash);
|
||||
void setRetroShareLink(const QString& url) {this->url = url;}
|
||||
const QString& getRetroShareLink() const {return url;}
|
||||
|
||||
bool isValid() const;
|
||||
|
||||
// Get file name, size, hash from kommute link list.
|
||||
// Return true if kommute link is valid, otherwise return false.
|
||||
bool getFileInformation(QVector<RetroShareLinkData>& linkList);
|
||||
|
||||
private:
|
||||
enum PARTITION
|
||||
{
|
||||
HEADER_,
|
||||
NAME_,
|
||||
SIZE_,
|
||||
HASH_,
|
||||
NUMBER_OF_PARTITIONS
|
||||
};
|
||||
|
||||
static const QString HEADER_NAME;
|
||||
|
||||
QString url;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue