Hydra 0.20
hydra Namespace Reference

Classes

class  ArgumentParser
class  DB
class  Cursor
class  DirChangeEvent
class  DirMonitor
class  DirDBUpdater
class  Engine
class  FileIterator
class  NodePath
class  Token
class  Record
class  FilePathRecord
class  FileHashRecord
class  Tags
class  FileItemRecord
class  Registry
class  Register
class  MutexData
class  MutexPtr
class  Thumb
class  WebExport

Typedefs

typedef std::set< QString > tags_t

Functions

int commandImport (const QString &filename, bool smartmerge)
void pruneDirectory (const QString &dirname)
short detectExifRotate (const QString &filename)
QString makeAbsolute (const QString &s)
QString justName (const QString &s)
bool isNormalFile (const QString &justname)
bool isNormalDirectory (const QString &justdirname)
bool isImageFile (const QString &justname)
bool mkDir (const QString &name)
bool linkFile (const QString &srcfile, const QString &destfile)
bool moveFile (const QString &srcfile, const QString &destfile)
bool delFile (const QString &srcfile)
bool copyFile (const QString &srcfile, const QString &destfile)
bool smartCopy (const QString &srcfile, const QString &destfile)
bool delDir (const QString &dirpath)
QString calcFileHash (const QString &filename)
int scoreValue (const tags_t &tags)
bool isQueryChar (const QChar &c)
bool parseQueryTokens (const QString &s, std::shared_ptr< hydra::Token > &tok)
quint64 dateTimeAsInt64 (const QDateTime &dt)
void int64ToDateTime (quint64 i, QDateTime &out)
template<class BASE , class SUB >
BASE * loadfunc_impl (void)
int rotateCodeToDegrees (int rotateCode)
int rotateDegreesToCode (int degrees)
int rotateCodeAdd (int rotateCode, int deltaCode)
short detectTagRotate (const hydra::FileItemRecord::tags_t &tags)
void rotateSizeByCode (short rotatecode, unsigned long origW, unsigned long origH, unsigned long &newW, unsigned long &newH)
QImage rotateImageByCode (short rotatecode, QImage &img)
QPixmap rotatePixmapByCode (short rotatecode, QPixmap &pix)
short detectMultiRotate (const QString &filename, const hydra::FileItemRecord::tags_t &tags)
void calcAspect (unsigned long C, unsigned long R, unsigned long WC, unsigned long WR, unsigned long &c, unsigned long &r, bool growtofit)
QString escapeForXML (const QString &s)

Detailed Description

The core hydra namespace contains all the classes of the core hydra library.

Author:
Aleksander Demko

Function Documentation

void hydra::calcAspect ( unsigned long  C,
unsigned long  R,
unsigned long  WC,
unsigned long  WR,
unsigned long &  c,
unsigned long &  r,
bool  growtofit 
)

Retains the aspect ratio on resized dimensions.

C, R current image width, heigth WC WR the designed (wanted) width, heigth c, r the resulting width, height

Parameters:
growtofitif true, images smaller than desired will be scaled UP to fit
Author:
Aleksander Demko
QString hydra::calcFileHash ( const QString &  filename)

Calculates the has of the given file.

Returns:
The hash of the file (in ascii form) or an empty string on error.
Author:
Aleksander Demko
short hydra::detectExifRotate ( const QString &  filename)

Detects the auto rotation information in the file, if any. returns: -1 error/no exif found. 0 do not rotate 1 rotate 90 degrees cw 2 rotate 180 degrees cw 3 rotate 270 degrees cw

If exif detection support is not compiled, this function will always return 0.

Author:
Aleksander Demko
short hydra::detectMultiRotate ( const QString &  filename,
const hydra::FileItemRecord::tags_t tags 
)

Uses both detectExifRotate and detectTagRotate to come up with a reasonable default. Will never return -1 (will return 0 instead).

Author:
Aleksander Demko
short hydra::detectTagRotate ( const hydra::FileItemRecord::tags_t tags)

Detects the auto rotation information in the file, if any. -1 error/no exif found. 0 do not rotate 1 rotate 90 degrees cw 2 rotate 180 degrees cw 3 rotate 270 degrees cw

If exif detection support is not compiled, this function will always return 0.

Author:
Aleksander Demko
bool hydra::isImageFile ( const QString &  justname)

Is this an image file.

Author:
Aleksander Demko
bool hydra::isNormalDirectory ( const QString &  justdirname)

Returns true if the given directory is "normal". A normal file is one that isn't hidden. A hidden file starts with a .

Author:
Aleksander Demko
bool hydra::isNormalFile ( const QString &  justname)

Is this a normal file. A normal file doesnt begin with _ . or ,

Author:
Aleksander Demko
QString hydra::justName ( const QString &  s)

Returns just the filename and extension.

Author:
Aleksander Demko
QString hydra::makeAbsolute ( const QString &  s)

Return the given file as a unique, absolute filename.

Author:
Aleksander Demko
bool hydra::mkDir ( const QString &  name)

Creates a directory.

Author:
Aleksander Demko
bool hydra::parseQueryTokens ( const QString &  s,
std::shared_ptr< hydra::Token > &  tok 
)

Parse a given search/query string into a token tree. Returns true on success, false on failure. tok is no modified on failures. Empty strings return an always true query that matches everything. The resulting hydra::Token can they be used to test against hydra::Tags

Author:
Aleksander Demko
int hydra::rotateCodeAdd ( int  rotateCode,
int  deltaCode 
)

Adds the given amount (which can be negative)o to the rotateCode and returns the result. The returned result is always valid (0..3)

Author:
Aleksander Demko
int hydra::rotateCodeToDegrees ( int  rotateCode) [inline]

Converts a rotate code to degrees, for display.

Author:
Aleksander Demko
int hydra::rotateDegreesToCode ( int  degrees)

Converts degrees to a rotate code. Returns -1 on invalid codes.

Author:
Aleksander Demko
QImage hydra::rotateImageByCode ( short  rotatecode,
QImage &  img 
)

Rotates an image as per the given rotate code. 0 do not rotate 1 rotate 90 degrees cw 2 rotate 180 degrees cw 3 rotate 270 degrees cw rotatecode must be >=0

Author:
Aleksander Demko
QPixmap hydra::rotatePixmapByCode ( short  rotatecode,
QPixmap &  pix 
)

Rotates an pixmap as per the given rotate code. 0 do not rotate 1 rotate 90 degrees cw 2 rotate 180 degrees cw 3 rotate 270 degrees cw rotatecode must be >=0

Author:
Aleksander Demko
void hydra::rotateSizeByCode ( short  rotatecode,
unsigned long  origW,
unsigned long  origH,
unsigned long &  newW,
unsigned long &  newH 
)

Converts the given coordinates to the final coordinates, as if it where rotated by the given exif rotation code. Node, the variables can the same (&origW == newW, etc)

Author:
Aleksander Demko
int hydra::scoreValue ( const tags_t &  tags)

Finds and returns the length of the score tag. If none, 0 is returned.

Author:
Aleksander Demko
bool hydra::smartCopy ( const QString &  srcfile,
const QString &  destfile 
)

A "smart" copy. If the file exists, this function will fail. Otherwise, it will try to LINK the file. If that files, it will do a copy operation

Returns:
true on success
Author:
Aleksander Demko
 All Classes Namespaces Functions Variables