mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-20 00:41:23 +00:00
bed9fbb5e1
svn path=/trunk/kdebase/kfind/; revision=3
77 lines
2 KiB
C++
77 lines
2 KiB
C++
/***********************************************************************
|
|
*
|
|
* KfArchiver.h
|
|
*
|
|
**********************************************************************/
|
|
|
|
class QString;
|
|
class QStrList;
|
|
|
|
class KfArchiver
|
|
{
|
|
public:
|
|
// Create a KfArchiver
|
|
KfArchiver() {};
|
|
|
|
/*
|
|
* Create a KfArchiver with archiver
|
|
*/
|
|
KfArchiver(const char*);
|
|
|
|
//~KfArchiver();
|
|
|
|
/// Initialize archivers
|
|
/* Call this function before you call any other function.
|
|
* This function initializes global variable
|
|
*/
|
|
static void init();
|
|
|
|
/// This function scans file ~/.kfindrc for archivers
|
|
static void initArchivers();
|
|
|
|
/// returns archiver name
|
|
const char* getArName() { return arName; };
|
|
|
|
/// returns comment for archiver
|
|
const char* getArComment() { return arComment; };
|
|
/// returns command for creating new archive
|
|
const char* getOnCreate() { return arOnCreate; };
|
|
|
|
/// returns command for updating archive
|
|
const char* getOnUpdate() { return arOnUpdate; };
|
|
|
|
/// returns valid pattern for archive
|
|
/*
|
|
* Returns the extensions assoziated with this archiver,
|
|
* for example '.tar.gz' or '.zip'.
|
|
*/
|
|
QStrList& getArPattern() { return arPattern; };
|
|
|
|
/// Sets the comment
|
|
void setComment( const char *_c) { arComment = _c; }
|
|
|
|
/// Sets the command for archive creating
|
|
void setOnCreate( const char *_command) { arOnCreate = _command; }
|
|
|
|
/// Sets the command for archive updating
|
|
void setOnUpdate( const char *_command) { arOnUpdate = _command; }
|
|
|
|
/// Add a pattern which matches this type.
|
|
virtual void addPattern( const char *_p )
|
|
{ if ( arPattern.find( _p ) == -1 ) arPattern.append( _p ); }
|
|
|
|
/// Find archiver by pattern.
|
|
/**
|
|
If for the given pattern no KfArchiver has been created, the function
|
|
will retun 0L;
|
|
*/
|
|
static KfArchiver *findByPattern( const char *_pattern );
|
|
|
|
protected:
|
|
QString arName;
|
|
QString arComment;
|
|
QString arOnCreate;
|
|
QString arOnUpdate;
|
|
QStrList arPattern;
|
|
};
|