You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
166 lines
5.5 KiB
166 lines
5.5 KiB
15 years ago
|
/***************************************************************************
|
||
|
configurationclasses.h - description
|
||
|
-------------------
|
||
|
begin : Sat Apr 17 2004
|
||
|
copyright : (C) 2004 Emiliano Gulmini
|
||
|
email : <emi_barbarossa@yahoo.it>
|
||
|
***************************************************************************/
|
||
|
|
||
|
/***************************************************************************
|
||
|
* *
|
||
|
* 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. *
|
||
|
* *
|
||
|
***************************************************************************/
|
||
|
#ifndef CONFIGURATIONCLASSES_H
|
||
|
#define CONFIGURATIONCLASSES_H
|
||
|
|
||
|
// QT
|
||
15 years ago
|
#include <tqstring.h>
|
||
|
#include <tqstringlist.h>
|
||
|
#include <tqdatetime.h>
|
||
|
#include <tqmap.h>
|
||
|
#include <tqregexp.h>
|
||
15 years ago
|
|
||
15 years ago
|
typedef TQMap<TQString,TQString> KeyValueMap;
|
||
12 years ago
|
// entry strings in the tdefilereplacerc file
|
||
15 years ago
|
const TQString rcDirectoriesList = "Directories list";
|
||
|
const TQString rcFiltersList = "Filters list";
|
||
|
const TQString rcRecentFiles = "Recent files";
|
||
|
const TQString rcAllStringsMustBeFound = "All strings must be found";
|
||
|
const TQString rcEncoding = "Encoding";
|
||
|
const TQString rcCaseSensitive = "Case sensitive";
|
||
|
const TQString rcConfirmStrings = "Confirm strings";
|
||
|
const TQString rcConfirmFiles = "Confirm files";
|
||
|
const TQString rcConfirmDirs = "Confirm directories";
|
||
|
const TQString rcFollowSymLinks = "Follow symbolic links";
|
||
|
const TQString rcHaltOnFirstOccur = "Halt on first occurrence";
|
||
|
const TQString rcIgnoreHidden = "Ignore hidden files";
|
||
|
const TQString rcRecursive = "Search/replace in sub folders";
|
||
|
const TQString rcVariables = "Enable variables";
|
||
|
const TQString rcRegularExpressions = "Enable regular expressions";
|
||
|
const TQString rcMinFileSize = "Minimum file size";
|
||
|
const TQString rcMaxFileSize = "Maximum file size";
|
||
|
const TQString rcValidAccessDate = "Access mode";
|
||
|
const TQString rcMinDate = "Minimum access date";
|
||
|
const TQString rcMaxDate = "Maximum access date";
|
||
|
const TQString rcOwnerUser = "Owner user filters";
|
||
|
const TQString rcOwnerGroup = "Owner group filters";
|
||
|
const TQString rcSearchMode = "Search only mode";
|
||
|
const TQString rcBackupExtension = "Backup file extension";
|
||
|
const TQString rcIgnoreFiles = "Ignore files if there is no match";
|
||
|
const TQString rcNotifyOnErrors = "NotifyOnErrors";
|
||
13 years ago
|
const TQString rcAskConfirmReplace = "Ask confirmation on replace";
|
||
15 years ago
|
const TQString rcDontAskAgain = "Dont ask again";
|
||
15 years ago
|
// Default configuration options
|
||
15 years ago
|
const TQString EncodingOption = "utf8";
|
||
15 years ago
|
const bool RecursiveOption = true;
|
||
|
const bool CaseSensitiveOption = false;
|
||
|
const bool FollowSymbolicLinksOption = false;
|
||
|
const bool RegularExpressionsOption = false;
|
||
|
const bool VariablesOption = false;
|
||
|
const bool StopWhenFirstOccurenceOption = false;
|
||
|
const bool IgnoreHiddenOption = false;
|
||
|
const int FileSizeOption = -1;
|
||
15 years ago
|
const TQString AccessDateOption="unknown";
|
||
|
const TQString ValidAccessDateOption="unknown";
|
||
|
const TQString OwnerOption="false,Name,Equals To";
|
||
15 years ago
|
const bool SearchModeOption=true;
|
||
15 years ago
|
const TQString BackupExtensionOption="false,~";
|
||
15 years ago
|
const bool IgnoreFilesOption = true;
|
||
|
const bool NotifyOnErrorsOption = false;
|
||
|
const bool AskConfirmReplaceOption = false;
|
||
|
|
||
|
// This class store configuration informations
|
||
|
class RCOptions
|
||
|
{
|
||
|
public:
|
||
|
bool m_callResetActions;
|
||
|
|
||
|
bool m_askConfirmReplace,
|
||
|
m_dontAskAgain;
|
||
|
|
||
15 years ago
|
TQStringList m_directories;
|
||
|
TQStringList m_filters;
|
||
|
TQString m_currentDirectory;
|
||
15 years ago
|
|
||
|
int m_minSize,
|
||
|
m_maxSize;
|
||
|
|
||
15 years ago
|
TQString m_dateAccess,
|
||
15 years ago
|
m_minDate,
|
||
|
m_maxDate;
|
||
|
|
||
15 years ago
|
TQString m_encoding;
|
||
15 years ago
|
|
||
|
bool m_caseSensitive,
|
||
|
m_recursive,
|
||
|
m_followSymLinks,
|
||
|
m_allStringsMustBeFound,
|
||
|
m_backup,
|
||
|
m_regularExpressions;
|
||
|
|
||
|
bool m_variables,
|
||
|
m_haltOnFirstOccur,
|
||
|
m_ignoreHidden,
|
||
|
m_simulation,
|
||
|
m_searchingOnlyMode;
|
||
|
|
||
|
bool m_ownerUserIsChecked,
|
||
|
m_ownerGroupIsChecked;
|
||
|
|
||
15 years ago
|
TQString m_ownerUserType,
|
||
15 years ago
|
m_ownerGroupType,
|
||
|
m_ownerUserValue,
|
||
|
m_ownerGroupValue,
|
||
|
m_ownerUserBool,
|
||
|
m_ownerGroupBool;
|
||
|
|
||
15 years ago
|
TQString m_backupExtension;
|
||
15 years ago
|
|
||
|
bool m_ignoreFiles;
|
||
|
|
||
|
KeyValueMap m_mapStringsView;
|
||
|
|
||
15 years ago
|
TQString m_quickSearchString,
|
||
15 years ago
|
m_quickReplaceString;
|
||
|
|
||
15 years ago
|
TQStringList m_recentStringFileList;
|
||
15 years ago
|
|
||
|
bool m_notifyOnErrors;
|
||
|
|
||
|
public:
|
||
|
RCOptions();
|
||
|
RCOptions& operator=(const RCOptions& ci);
|
||
|
};
|
||
|
|
||
|
class ResultViewEntry
|
||
|
{
|
||
|
private:
|
||
15 years ago
|
TQString m_key;
|
||
|
TQString m_data;
|
||
|
TQRegExp m_rxKey;
|
||
15 years ago
|
bool m_regexp;
|
||
|
bool m_caseSensitive;
|
||
|
int m_pos;
|
||
|
int m_matchedStringsOccurrence;
|
||
|
|
||
|
public:
|
||
15 years ago
|
ResultViewEntry(TQString nkey, TQString ndata, bool regexp, bool caseSensitive);
|
||
|
int lineNumber(const TQString& line) const ;
|
||
|
int columnNumber(const TQString& line) const ;
|
||
15 years ago
|
void incOccurrences();
|
||
|
int occurrences() const ;
|
||
|
bool regexp()const ;
|
||
15 years ago
|
int pos(const TQString& line) ;
|
||
15 years ago
|
void incPos();
|
||
15 years ago
|
TQString capturedText(const TQString& line) ;
|
||
|
TQString message(const TQString& capturedText, int x, int y) const;
|
||
15 years ago
|
int keyLength() const;
|
||
|
int dataLength() const;
|
||
15 years ago
|
void updateLine(TQString& line);
|
||
15 years ago
|
};
|
||
|
#endif
|