OpendTect  6.3
filemultispec.h
Go to the documentation of this file.
1 #pragma once
2 
3 /*+
4 ________________________________________________________________________
5 
6  (C) dGB Beheer B.V.; (LICENSE) http://opendtect.org/OpendTect_license.txt
7  Author: Bert
8  Date: Sep 2015
9  RCS: $Id: $
10 ________________________________________________________________________
11 
12 -*/
13 
14 #include "basicmod.h"
15 #include "bufstringset.h"
16 #include "ranges.h"
17 
18 
19 namespace File
20 {
21 
31 {
32 public:
33 
34  MultiSpec(const char* fnm=0);
35  MultiSpec(const IOPar&);
36 
39  int zeropad_;
41 
42  bool isEmpty() const
43  { return fnames_.isEmpty() || fnames_.get(0).isEmpty();}
44  bool isMulti() const { return nrFiles() > 1; }
45  bool isRangeMulti() const;
46 
47  int nrFiles() const;
48  const char* fileName(int nr=0) const;
49  const char* absFileName(int nr=0) const;
50  const char* dirName() const;
51  const char* fullDirName() const;
52 
53  const char* dispName() const;
54  const char* usrStr() const;
55  void setUsrStr( const char* str ) { usrstr_ = str; }
56 
57  void setEmpty()
58  { fnames_.setEmpty(); mSetUdf(nrs_.start); }
59  void setFileName( const char* nm )
60  { setEmpty(); if ( nm && *nm ) fnames_.add(nm);}
61  void ensureBaseDir(const char* dirnm);
62  void makeAbsoluteIfRelative(const char* dirnm);
63 
64  void fillPar(IOPar&) const;
65  bool usePar(const IOPar&);
66  void getReport(IOPar&) const;
67  static const char* sKeyFileNrs();
68 
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 } // namespace File
#define mExpClass(module)
Definition: commondefs.h:157
Interface for several file and directory related services.
Definition: file.h:29
void setUsrStr(const char *str)
Definition: filemultispec.h:55
BufferString survsubdir_
For example sSeismicSubDir()
Definition: filemultispec.h:40
#define mSetUdf(val)
Use this macro to set simple types to undefined.
Definition: undefval.h:272
void usePar(const IOPar &iop, ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:200
Specification for one or more files.
Definition: filemultispec.h:30
BufferString & get(size_type idx)
Definition: bufstringset.h:49
Set of BufferString objects.
Definition: bufstringset.h:25
BufferString usrstr_
Definition: filemultispec.h:76
BufferStringSet fnames_
Definition: filemultispec.h:37
Generalized set of parameters of the keyword-value type.
Definition: iopar.h:53
void setFileName(const char *nm)
Definition: filemultispec.h:59
void setEmpty()
Definition: filemultispec.h:57
BufferStringSet & add(const char *)
void setEmpty()
Definition: bufstringset.h:56
bool isMulti() const
Definition: filemultispec.h:44
void fillPar(IOPar &iop, const ODPolygon< T > &poly, const char *inpkey)
Definition: polygon.h:187
bool isEmpty() const
Definition: filemultispec.h:42
StepInterval< int > nrs_
Definition: filemultispec.h:38
OD::String with its own variable length buffer. The buffer has a guaranteed minimum size...
Definition: bufstring.h:38
bool isEmpty() const
Definition: odstring.h:49
bool isEmpty() const
Definition: bufstringset.h:38
T start
Definition: ranges.h:90
int zeropad_
left-pad the nrs_ to this length
Definition: filemultispec.h:39

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