OpendTect-6_4  6.4
filespec.h
Go to the documentation of this file.
1 #ifndef filespec_h
2 #define filespec_h
3 
4 /*+
5 ________________________________________________________________________
6 
7  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
8  Author: Bert
9  Date: Sep 2015
10  RCS: $Id: $
11 ________________________________________________________________________
12 
13 -*/
14 
15 #include "basicmod.h"
16 #include "bufstringset.h"
17 #include "ranges.h"
18 
19 
29 {
30 public:
31 
32  FileSpec(const char* fnm=0);
33  FileSpec(const IOPar&);
34 
37  int zeropad_;
39 
40  bool isEmpty() const
41  { return fnames_.isEmpty() || fnames_.get(0).isEmpty();}
42  bool isMulti() const { return nrFiles() > 1; }
43  bool isRangeMulti() const;
44 
45  int nrFiles() const;
46  const char* fileName(int nr=0) const;
47  const char* absFileName(int nr=0) const;
48  const char* dirName() const;
49  const char* fullDirName() const;
50 
51  const char* dispName() const;
52  const char* usrStr() const;
53  void setUsrStr( const char* str ) { usrstr_ = str; }
54 
55  void setEmpty()
56  { fnames_.setEmpty(); mSetUdf(nrs_.start); }
57  void setFileName( const char* nm )
58  { setEmpty(); if ( nm && *nm ) fnames_.add(nm);}
59  void ensureBaseDir(const char* dirnm);
60  void makeAbsoluteIfRelative(const char* dirnm);
61 
62  void fillPar(IOPar&) const;
63  bool usePar(const IOPar&);
64  void getReport(IOPar&) const;
65  static const char* sKeyFileNrs();
66 
67  void makePathsRelative(const char* todir=0);
68  //< default is survey directory
69  static void makePathsRelative(IOPar&,const char* todir=0);
70  //< default is survey directory
71 
72  void getMultiFromString(const char*);
73 
74 protected:
75 
77 
78 };
79 
80 
81 #endif
#define mExpClass(module)
Definition: commondefs.h:160
StepInterval< int > nrs_
Definition: filespec.h:36
#define mSetUdf(val)
Use this macro to set simple types to undefined.
Definition: undefval.h:274
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:188
bool isEmpty() const
Definition: odset.h:45
Set of BufferString objects.
Definition: bufstringset.h:28
void setEmpty()
Definition: filespec.h:55
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:47
bool isMulti() const
Definition: filespec.h:42
void setEmpty()
Definition: odset.h:46
BufferStringSet & add(const char *)
bool isEmpty() const
Definition: filespec.h:40
BufferStringSet fnames_
Definition: filespec.h:35
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:175
Specification for one or more files.
Definition: filespec.h:28
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:40
BufferString usrstr_
Definition: filespec.h:76
bool isEmpty() const
Definition: odstring.h:51
int zeropad_
left-pad the nrs_ to this length
Definition: filespec.h:37
void setFileName(const char *nm)
Definition: filespec.h:57
T start
Definition: ranges.h:92
BufferString & get(int idx)
Definition: bufstringset.h:36
void setUsrStr(const char *str)
Definition: filespec.h:53
BufferString survsubdir_
For example "Seismics".
Definition: filespec.h:38

Generated at for the OpendTect seismic interpretation project. Copyright (C): dGB Beheer B. V. 2019