Xmipp  v3.23.11-Nereus
Classes | Macros | Functions
metadata_base.h File Reference
#include <cstddef>
#include <map>
#include <cmath>
#include <memory>
#include <iostream>
#include "xmipp_error.h"
#include "xmipp_filename.h"
#include "metadata_label.h"
#include "metadata_writemode.h"
#include "metadata_base_it.h"
#include "metadata_static.h"
#include "metadata_query.h"
#include "choose.h"
Include dependency graph for metadata_base.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  mdBuffer
 
struct  mdBlock
 
class  ObjectDoesNotExist
 
class  NotImplemented
 
class  ColumnDoesNotExist
 
class  MetaData
 
struct  MetaData::rowIterator< IsConst >
 
struct  MetaData::idIterator< IsConst >
 
struct  MetaData::IdIteratorProxy< IsConst >
 

Macros

#define BAD_OBJID   0
 
#define BAD_INDEX   -1
 
#define FILENAME_XMIPP_STAR   "# XMIPP_STAR_1"
 
#define FILENAME_XMIPP_SQLITE   "SQLite format 3"
 
#define DEFAULT_BLOCK_NAME   "noname"
 
#define FOR_ALL_OBJECTS_IN_METADATA(__md)   for (size_t objId : __md.ids())
 
#define FOR_ALL_ROWS_IN_METADATA(__md)   for (auto& row : __md)
 
#define END_OF_LINE()   ((char*) memchr (iter, '\n', end-iter))
 
#define BUFFER_CREATE(b)   mdBuffer b; b.begin = nullptr; b.size = 0
 Some macros to use the buffer. More...
 
#define BUFFER_COPY(b1, b2)   mdBuffer b2; b2.begin = b1.begin; b2.size = b1.size
 
#define BUFFER_MOVE(b, n)   b.begin += n; b.size -= n
 
#define BUFFER_FIND(b, str, n)   (char*) _memmem(b.begin, b.size, str, n)
 
#define BLOCK_CREATE(b)   mdBlock b; b.begin = b.end = b.loop = nullptr; b.nameSize = 0
 Some macros to use the block pointers. More...
 
#define BLOCK_INIT(b)   b.begin = b.end = b.loop = nullptr; b.nameSize = 0
 
#define BLOCK_NAME(b, s)   s.assign(b.begin, b.nameSize)
 
#define line_max   70
 comment is wraped in char_max length lines More...
 

Functions

void getBlocksInMetaDataFile (const FileName &inFile, StringVector &blockList)
 
bool existsBlockInMetaDataFile (const FileName &inFile, const String &inBlock)
 
bool existsBlockInMetaDataFile (const FileName &inFileWithBlock)
 
std::ostream & operator<< (std::ostream &o, const MetaData &mD)
 
WriteModeMetaData metadataModeConvert (String mode)
 
bool vectorContainsLabel (const std::vector< MDLabel > &labelsVector, const MDLabel label)
 

Macro Definition Documentation

◆ line_max

#define line_max   70

comment is wraped in char_max length lines

Definition at line 187 of file metadata_base.h.

Function Documentation

◆ metadataModeConvert()

WriteModeMetaData metadataModeConvert ( String  mode)

Convert string to write mode metadata enum.

Definition at line 128 of file metadata_base.cpp.

128  {
129  toLower(mode);
130  if (mode.npos != mode.find("overwrite"))
131  return MD_OVERWRITE;
132  if (mode.npos != mode.find("append"))
133  return MD_APPEND;
134  REPORT_ERROR(ERR_ARG_INCORRECT,"metadataModeConvert: Invalid mode: "+mode);
135 }
#define REPORT_ERROR(nerr, ErrormMsg)
Definition: xmipp_error.h:211
Incorrect argument received.
Definition: xmipp_error.h:113
void mode
void toLower(char *_str)

◆ vectorContainsLabel()

bool vectorContainsLabel ( const std::vector< MDLabel > &  labelsVector,
const MDLabel  label 
)

Definition at line 137 of file metadata_base.cpp.

137  {
138  std::vector<MDLabel>::const_iterator location;
139  location = std::find(labelsVector.begin(), labelsVector.end(), label);
140  return (location != labelsVector.end());
141 }
std::vector< SelLine >::iterator find(std::vector< SelLine > &text, const std::string &img_name)
Definition: selfile.cpp:553