| Bsoft 2.0.5 Bernard's software package

file_util.h
Go to the documentation of this file.
1
9 #include "Bstring.h"
10 #include <fstream>
11
12 #ifndef _filetype_
13
20 enum FileType {
21 Unknown_FileType = 0, // Indeterminate
22 Image = 1, // Image file
23 Micrograph = 2, // Micrograph parameter file
24 Molecule = 3, // Molecular coordinate file
25 Model = 4, // Model parameter file
26 MgRelion = 11 // Relion micrograph
27 } ;
28 #define _filetype_
29 #endif
30
31 // Function prototypes
32 int fread_large(unsigned char* aptr, size_t pagesize, size_t offset, ifstream* fimg);
33 Bstring find_file(Bstring filename, Bstring path, int flag=0);
34 string find_file(string filename, string path, int flag=0);
35 FileType file_type(const char* filename);
36 FileType file_type(Bstring& filename);
37 int detect_and_fix_carriage_return(const char* filename);
38
FileType
FileType
File type enumeration.
Definition: file_util.h:20
Model
Definition: file_util.h:25
file_type
FileType file_type(const char *filename)
Checks the file type using the extension and contents.
Definition: file_util.cpp:178
Molecule
Definition: file_util.h:24
Micrograph
Definition: file_util.h:23
MgRelion
Definition: file_util.h:26
Bstring
Definition: Bstring.h:29
detect_and_fix_carriage_return
int detect_and_fix_carriage_return(const char *filename)
Detects carriage returns in text files and converts them to new-lines.
Definition: file_util.cpp:377
Image
Definition: file_util.h:22
fread_large
int fread_large(unsigned char *aptr, size_t pagesize, size_t offset, ifstream *fimg)
Reads blocks of memeory no larger than 1Gb.
Definition: file_util.cpp:347
Bstring.h
Header file for the string class.
Unknown_FileType
Definition: file_util.h:21
find_file
Bstring find_file(Bstring filename, Bstring path, int flag=0)
Searches for a file within or without the given path.
Definition: file_util.cpp:54