ESA JPIP server  0.1
jpeg2000::FileManager Class Reference

Manages the image files of a repository, allowing read their indexing information, with a caching mechanism for efficiency. More...

#include <file_manager.h>

Collaboration diagram for jpeg2000::FileManager:

Public Member Functions

string GetCacheFileName (const string &path_image_file)
 Returns the cache file name equivalent to the given image file name. More...
 
 FileManager ()
 Initializes the object. More...
 
 FileManager (string root_dir, string cache_dir)
 Initializes the object. More...
 
bool Init (string root_dir="./", string cache_dir="./")
 Initializes the object. More...
 
string root_dir () const
 Returns the root directory of the image repository. More...
 
string cache_dir () const
 Returns the directory used for caching. More...
 
bool ReadImage (const string &name_image_file, ImageInfo *image_info)
 Reads an image file and creates the associated cache file if it does not exist yet. More...
 
virtual ~FileManager ()
 

Private Member Functions

bool ExistCacheImage (const string &path_image_file, string *path_cache_file)
 Returns true if the cache file exists and it is updated. More...
 
bool ReadBoxHeader (const File &fim, uint32_t *type_box, uint64_t *length_box)
 Reads the header information. More...
 
bool ReadCodestream (const File &file, CodingParameters *params, CodestreamIndex *index)
 Reads the information of a codestream. More...
 
bool ReadSIZMarker (const File &file, CodingParameters *params)
 Reads the information of a SIZ marker. More...
 
bool ReadCODMarker (const File &file, CodingParameters *params)
 Reads the information of a COD marker. More...
 
bool ReadSOTMarker (const File &file, CodestreamIndex *index)
 Reads the information of a SOT marker. More...
 
bool ReadPLTMarker (const File &file, CodestreamIndex *index)
 Reads the information of a PLT marker. More...
 
bool ReadSODMarker (const File &file, CodestreamIndex *index)
 Reads the information of a SOD marker. More...
 
bool ReadJP2 (const File &file, ImageInfo *image_info)
 Reads the information of a JP2 image file. More...
 
bool ReadJPX (const File &file, ImageInfo *image_info)
 Reads the information of a JPX image file. More...
 
bool ReadNlstBox (const File &file, int *num_codestream, int length_box)
 Reads the information of a NLST box. More...
 
bool ReadFlstBox (const File &file, uint64_t length_box, uint16_t *data_reference)
 Reads the information of a FLST box. More...
 
bool ReadUrlBox (const File &file, uint64_t length_box, string *path_file)
 Reads the information of a URL box. More...
 

Private Attributes

string root_dir_
 Root directory of the repository. More...
 
string cache_dir_
 Caching directory. More...
 

Detailed Description

Manages the image files of a repository, allowing read their indexing information, with a caching mechanism for efficiency.

Constructor & Destructor Documentation

jpeg2000::FileManager::FileManager ( )
inline

Initializes the object.

jpeg2000::FileManager::FileManager ( string  root_dir,
string  cache_dir 
)
inline

Initializes the object.

Parameters
root_dirRoot directory of the image repository.
cache_dirDirectory for caching.

Here is the call graph for this function:

virtual jpeg2000::FileManager::~FileManager ( )
inlinevirtual

Member Function Documentation

string jpeg2000::FileManager::cache_dir ( ) const
inline

Returns the directory used for caching.

Here is the caller graph for this function:

bool jpeg2000::FileManager::ExistCacheImage ( const string &  path_image_file,
string *  path_cache_file 
)
private

Returns true if the cache file exists and it is updated.

Parameters
path_image_filePath of the image file.
path_cache_fileReceives the path of the associated cache file.
string jpeg2000::FileManager::GetCacheFileName ( const string &  path_image_file)

Returns the cache file name equivalent to the given image file name.

Here is the caller graph for this function:

bool jpeg2000::FileManager::Init ( string  root_dir = "./",
string  cache_dir = "./" 
)
inline

Initializes the object.

Parameters
root_dirRoot directory of the image repository.
cache_dirDirectory for caching.
Returns
true if successful

Here is the call graph for this function:

Here is the caller graph for this function:

bool jpeg2000::FileManager::ReadBoxHeader ( const File fim,
uint32_t *  type_box,
uint64_t *  length_box 
)
private

Reads the header information.

of a JP2/JPX box.

Parameters
fimImage file.
type_boxReceives the type of the box.
length_boxReceives the length of the box.
Returns
true if successful.

Here is the call graph for this function:

bool jpeg2000::FileManager::ReadCodestream ( const File file,
CodingParameters params,
CodestreamIndex index 
)
private

Reads the information of a codestream.

Parameters
fileImage file.
paramsReceives the coding parameters.
indexReceives the indexing information.
Returns
true if successful.

Here is the call graph for this function:

bool jpeg2000::FileManager::ReadCODMarker ( const File file,
CodingParameters params 
)
private

Reads the information of a COD marker.

Parameters
fileImage file.
paramsPointer to the coding parameters to update.
Returns
true if successful.

Here is the call graph for this function:

bool jpeg2000::FileManager::ReadFlstBox ( const File file,
uint64_t  length_box,
uint16_t *  data_reference 
)
private

Reads the information of a FLST box.

Parameters
fileImage file.
length_boxBox length in bytes.
data_referenceReceives the data reference.
Returns
true if successful.

Here is the call graph for this function:

bool jpeg2000::FileManager::ReadImage ( const string &  name_image_file,
ImageInfo image_info 
)

Reads an image file and creates the associated cache file if it does not exist yet.

Parameters
name_image_fileFile name of the image.
image_infoReceives the information of the image.
Returns
true if successful.

Here is the call graph for this function:

bool jpeg2000::FileManager::ReadJP2 ( const File file,
ImageInfo image_info 
)
private

Reads the information of a JP2 image file.

Parameters
fileImage file.
image_infoReceives the image information.
Returns
true if successful.

Here is the call graph for this function:

bool jpeg2000::FileManager::ReadJPX ( const File file,
ImageInfo image_info 
)
private

Reads the information of a JPX image file.

Parameters
fileImage file.
image_infoReceives the image information.
Returns
true if successful.

Here is the call graph for this function:

bool jpeg2000::FileManager::ReadNlstBox ( const File file,
int *  num_codestream,
int  length_box 
)
private

Reads the information of a NLST box.

Parameters
fileImage file.
num_codestreamReceives the number of codestream read.
length_boxBox length in bytes.
Returns
true if successful.

Here is the call graph for this function:

bool jpeg2000::FileManager::ReadPLTMarker ( const File file,
CodestreamIndex index 
)
private

Reads the information of a PLT marker.

Parameters
fileImage file.
indexPointer to the indexing information to update.
Returns
true if successful.

Here is the call graph for this function:

bool jpeg2000::FileManager::ReadSIZMarker ( const File file,
CodingParameters params 
)
private

Reads the information of a SIZ marker.

Parameters
fileImage file.
paramsPointer to the coding parameters to update.
Returns
true if successful.

Here is the call graph for this function:

bool jpeg2000::FileManager::ReadSODMarker ( const File file,
CodestreamIndex index 
)
private

Reads the information of a SOD marker.

Parameters
fileImage file.
indexPointer to the indexing information to update.
Returns
true if successful.

Here is the call graph for this function:

bool jpeg2000::FileManager::ReadSOTMarker ( const File file,
CodestreamIndex index 
)
private

Reads the information of a SOT marker.

Parameters
fileImage file.
indexPointer to the indexing information to update.
Returns
true if successful.

Here is the call graph for this function:

bool jpeg2000::FileManager::ReadUrlBox ( const File file,
uint64_t  length_box,
string *  path_file 
)
private

Reads the information of a URL box.

Parameters
fileImage file.
length_boxBox length in bytes.
path_fileReceives the URL path read.
Returns
true if successful.

Here is the call graph for this function:

string jpeg2000::FileManager::root_dir ( ) const
inline

Returns the root directory of the image repository.

Here is the caller graph for this function:

Member Data Documentation

string jpeg2000::FileManager::cache_dir_
private

Caching directory.

string jpeg2000::FileManager::root_dir_
private

Root directory of the repository.


The documentation for this class was generated from the following files: