LightsprintSDK 2021.08.08
rr::RRHash Class Reference

#include <RRHash.h>

Public Member Functions

 RRHash ()
 
 RRHash (const unsigned char *data, unsigned size)
 
RRString getFileName (unsigned version, const char *prefix, const char *postfix) const
 
bool operator!= (const RRHash &a) const
 
void operator+= (const RRHash &a)
 

Public Attributes

unsigned char value [20]
 

Detailed Description

Helper class that calculates/stores hash and converts it to filename.

Constructor & Destructor Documentation

◆ RRHash() [1/2]

rr::RRHash::RRHash ( )

Resets value to 0.

◆ RRHash() [2/2]

rr::RRHash::RRHash ( const unsigned char *  data,
unsigned  size 
)

Calculates hash value from data.

Member Function Documentation

◆ getFileName()

RRString rr::RRHash::getFileName ( unsigned  version,
const char *  prefix,
const char *  postfix 
) const

Returns filename created from hash value, in format prefix + hash + postfix.

Parameters
versionAdditional number melted into hash, different versions produce different filenames.
prefixOptional prefix (e.g. "c:/path/") of returned filename. If nullptr, temporary directory is used.
postfixOptional postfix (e.g. ".extension") of returned filename. If nullptr, no postfix is appended.

◆ operator!=()

bool rr::RRHash::operator!= ( const RRHash a) const

◆ operator+=()

void rr::RRHash::operator+= ( const RRHash a)

Member Data Documentation

◆ value

unsigned char rr::RRHash::value[20]

Hash value.