MeVisLabToolboxReference
MeVis/Foundation/Sources/DicomTree/MLDicomTree/DCMTree_Utils.h File Reference

Utility-function library for DCMTree. More...

#include <string>
#include <list>
#include <istream>
#include <ostream>
#include "DCMTree_Lib.h"
#include "DCMTree_Defines.h"

Go to the source code of this file.

Classes

class  DCMTree_Utils::LoadLibraryDelegate
 the delegate who is responsible for loading the specific DICOM library used in initialization, if the library is not loaded statically (via the DEF file) More...

Namespaces

namespace  DCMTree_Utils
 

dictionary class to provide dicom-meta information


Typedefs

typedef std::list< std::string > DCMTree_Utils::StringList
 a list of strings
typedef void(* DCMTree_Utils::LoggingHandler )(std::string, int)

Functions

const std::string DCMTree_Utils::configInstallPath ()
 get path where the current application is installed
const std::list< std::string > DCMTree_Utils::configLibraryPathList (const std::string &installPath)
 get list of paths where to search for dynamic libraries
bool DCMTree_Utils::configLoadDll (std::string dllPath)
 load a dynamic library from the specified path returns true on success else false
DCMTREE_EXPORT void DCMTree_Utils::configLoadLibraries (LoadLibraryDelegate *delegate=NULL)
 load dynamic libraries, search in file DCMTree.cfg for their names
DCMTREE_EXPORT StringList DCMTree_Utils::split (const std::string &tosplit, char c, bool skipempties=false)
 split the given string at each c if skipempties is true, all empty results would be removed
DCMTREE_EXPORT std::string DCMTree_Utils::toString (const DCMTree::Date &date)
 convert a date to a string
DCMTREE_EXPORT std::string DCMTree_Utils::toString (const DCMTree::Time &time)
 convert a time to a string
DCMTREE_EXPORT std::string DCMTree_Utils::toString (const DCMTree::DateTime &datetime)
 convert a datetime to a string
DCMTREE_EXPORT std::string DCMTree_Utils::toString (int val)
 convert a int to a string
DCMTREE_EXPORT std::string DCMTree_Utils::toString (unsigned int val)
 convert a unsigned int to a string
DCMTREE_EXPORT std::string DCMTree_Utils::toString (float val)
 convert a float to a string
DCMTREE_EXPORT std::string DCMTree_Utils::toString (double val)
 convert a double to a string
DCMTREE_EXPORT DCMTree::Date DCMTree_Utils::toDate (const std::string &str)
 convert a string to date
DCMTREE_EXPORT DCMTree::Time DCMTree_Utils::toTime (const std::string &str)
 convert a string to time
DCMTREE_EXPORT DCMTree::DateTime DCMTree_Utils::toDateTime (const std::string &str)
 convert a string to datetime
DCMTREE_EXPORT std::string DCMTree_Utils::digitsOnly (const std::string &str, bool allowhex=false)
 remove all non-digits from the given strings if allowhex is true 'a'-'f','A'-'F' are preserved too
DCMTREE_EXPORT std::string DCMTree_Utils::afterFractionPart (const std::string &str)
 get the part of the string after the right-most dot if there is no dot in the string the result is empty
DCMTREE_EXPORT std::string DCMTree_Utils::beforeFractionPart (const std::string &str)
 get the part of the string before the right-most dot if there is no dot in the string the result is the given string
DCMTREE_EXPORT int DCMTree_Utils::hexToInt (const std::string &str)
 convert a hex-string to int
DCMTREE_EXPORT unsigned int DCMTree_Utils::hexToUInt (const std::string &str)
 convert a hex-string to unsigned int
DCMTREE_EXPORT int DCMTree_Utils::toInt (const std::string &str)
 convert a string to int
DCMTREE_EXPORT unsigned int DCMTree_Utils::toUInt (const std::string &str)
 convert a string to unsigned int
DCMTREE_EXPORT double DCMTree_Utils::toDouble (const std::string &str)
 convert a string to double
DCMTREE_EXPORT std::string DCMTree_Utils::toString (const DCMTree::Vr vr)
 convert a vr into a string
DCMTREE_EXPORT DCMTree::Vr DCMTree_Utils::toVr (const std::string &vrString)
 convert a string into vr.
DCMTREE_EXPORT void DCMTree_Utils::toStream (std::ostream &out, const std::string &val)
 helpers to put data into a stream
DCMTREE_EXPORT void DCMTree_Utils::toStream (std::ostream &out, const int &val)
DCMTREE_EXPORT void DCMTree_Utils::toStream (std::ostream &out, const unsigned int &val)
DCMTREE_EXPORT void DCMTree_Utils::toStream (std::ostream &out, const bool &val)
DCMTREE_EXPORT void DCMTree_Utils::toStream (std::ostream &out, const unsigned char *ptr, unsigned int size)
DCMTREE_EXPORT void DCMTree_Utils::fromStream (std::istream &in, std::string &val)
 helpers to get data out of a stream
DCMTREE_EXPORT void DCMTree_Utils::fromStream (std::istream &in, int &val)
DCMTREE_EXPORT void DCMTree_Utils::fromStream (std::istream &in, unsigned int &val)
DCMTREE_EXPORT void DCMTree_Utils::fromStream (std::istream &in, bool &val)
DCMTREE_EXPORT void DCMTree_Utils::fromStream (std::istream &in, unsigned char *ptr, unsigned int size)
DCMTREE_EXPORT void DCMTree_Utils::setLoggingHandler (LoggingHandler handler)
 Set a callback for logging purposes.
DCMTREE_EXPORT void DCMTree_Utils::logMessage (std::string message, int errorCode=0)
 Log a message using the provided callback, if any.
DCMTREE_EXPORT std::string DCMTree_Utils::condGetNameForTag (DCMTree::TagId tag, const std::string &defaultName)

Detailed Description

Utility-function library for DCMTree.

Author:
Sascha Bohnenkamp
Date:
10/2006

Definition in file DCMTree_Utils.h.