BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
FileCatalogue.cxx File Reference
#include "FileCatalogue.h"
#include "file_db_settings.h"
#include "nlohmann/json.hpp"
#include <fstream>
#include <iostream>
#include <map>
#include <sstream>
Include dependency graph for FileCatalogue.cxx:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  WriteData

Macros

#define FC_HAS_CURL_MIME   (LIBCURL_VERSION_NUM >= 0x073800)
#define FC_HAS_CURL_XFERINFO   (LIBCURL_VERSION_NUM >= 0x072000)

Enumerations

enum  State { CHECK_PREFIX , WRITE_FILE }

Functions

string const GetErrorString (int error_id)
int GiveMeNumber ()
std::string ReplaceAll (std::string str, const std::string &from, const std::string &to)
size_t appendData (void *contents, size_t size, size_t nmemb, string *data)
std::string exec (const char *cmd)
size_t WriteCallback (void *contents, size_t size, size_t nmemb, void *userp)
int progressCallback (void *clientp, double dltotal, double dlnow, double ultotal, double ulnow)

Variables

map< int, string > const Errors

Macro Definition Documentation

◆ FC_HAS_CURL_MIME

#define FC_HAS_CURL_MIME   (LIBCURL_VERSION_NUM >= 0x073800)

Definition at line 891 of file FileCatalogue.cxx.

◆ FC_HAS_CURL_XFERINFO

#define FC_HAS_CURL_XFERINFO   (LIBCURL_VERSION_NUM >= 0x072000)

Definition at line 892 of file FileCatalogue.cxx.

Enumeration Type Documentation

◆ State

enum State
Enumerator
CHECK_PREFIX 
WRITE_FILE 

Definition at line 792 of file FileCatalogue.cxx.

Function Documentation

◆ appendData()

size_t appendData ( void * contents,
size_t size,
size_t nmemb,
string * data )

Definition at line 450 of file FileCatalogue.cxx.

Referenced by FileCatalogue::performRequest(), and FileCatalogue::UploadFile().

Here is the caller graph for this function:

◆ exec()

std::string exec ( const char * cmd)

Definition at line 635 of file FileCatalogue.cxx.

Referenced by FileCatalogue::FileCatalogRequest().

Here is the caller graph for this function:

◆ GetErrorString()

string const GetErrorString ( int error_id)

Definition at line 22 of file FileCatalogue.cxx.

References Errors.

◆ GiveMeNumber()

int GiveMeNumber ( )

Definition at line 28 of file FileCatalogue.cxx.

References dist().

Here is the call graph for this function:

◆ progressCallback()

int progressCallback ( void * clientp,
double dltotal,
double dlnow,
double ultotal,
double ulnow )

Definition at line 898 of file FileCatalogue.cxx.

Referenced by FileCatalogue::UploadFile().

Here is the caller graph for this function:

◆ ReplaceAll()

std::string ReplaceAll ( std::string str,
const std::string & from,
const std::string & to )

Definition at line 125 of file FileCatalogue.cxx.

Referenced by FileCatalogue::GetFileList().

Here is the caller graph for this function:

◆ WriteCallback()

size_t WriteCallback ( void * contents,
size_t size,
size_t nmemb,
void * userp )

Definition at line 807 of file FileCatalogue.cxx.

References WriteData::buffer, CHECK_PREFIX, WriteData::error_detected, WriteData::error_msg, WriteData::file, WriteData::state, and WRITE_FILE.

Referenced by FileCatalogue::DownloadFile().

Here is the caller graph for this function:

Variable Documentation

◆ Errors

map<int, string> const Errors
Initial value:
{{401, "Unauthorized Access (check user login and password)"},
{403, "Token invalid or expired"},
{404, "Requested Data not found"},
{409, "Incorrect Database Request (e.g. violating constraints)"},
{422, "Incorrect Input Request"},
{500, "Internal Server Error"},
{503, "Service Unavaialble"},
{504, "Server Timeout"}}

Definition at line 13 of file FileCatalogue.cxx.