QXRD
0.11.16
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
qxrd
source
submodules
qceplib
qceplib-base
qcepimagedataformat.cpp
Go to the documentation of this file.
1
#include "
qcepimagedataformat.h
"
2
#include "
qcepimagedataformatfactory.h
"
3
#include <QFileInfo>
4
#include <QDir>
5
6
void
QcepImageDataFormatBase::mkPath
(QString filePath)
7
{
8
QFileInfo f(filePath);
9
QDir dir = f.dir();
10
11
if
(!dir.exists()) {
12
dir.mkpath(dir.absolutePath());
13
}
14
}
15
16
QString
QcepImageDataFormatBase::uniqueFileName
(QString
name
)
17
{
18
QFileInfo f(name);
19
20
if
(f.exists()) {
21
QDir dir = f.dir();
22
QString base = f.baseName();
23
QString suff = f.completeSuffix();
24
25
int
width = 5;
26
27
for
(
int
i=1; ; i++) {
28
QString newname = dir.filePath(base+QString().sprintf(
"-%0*d."
,width,i)+suff);
29
QFileInfo f(newname);
30
31
if
(!f.exists()) {
32
return
newname;
33
}
34
}
35
}
else
{
36
return
name
;
37
}
38
}
39
40
template
<
typename
T>
41
QcepImageDataFormat<T>::QcepImageDataFormat
(QString fmtname)
42
:
QcepImageDataFormatBase
(fmtname)
43
{
44
// printf("QcepImageDataFormatFactory<T>::factory()->insert(%s)\n", qPrintable(name()));
45
//
46
QcepImageDataFormatFactory<T>::factory
()->insert(
this
);
47
}
48
49
template
class
QcepImageDataFormat<unsigned short>
;
50
template
class
QcepImageDataFormat<short>
;
51
template
class
QcepImageDataFormat<unsigned int>
;
52
template
class
QcepImageDataFormat<int>
;
53
template
class
QcepImageDataFormat<double>
;
QcepImageDataFormatBase::uniqueFileName
QString uniqueFileName(QString name)
Definition:
qcepimagedataformat.cpp:16
qcepimagedataformatfactory.h
qcepimagedataformat.h
QcepImageDataFormatFactory::factory
static QcepImageDataFormatFactory< T > * factory()
Definition:
qcepimagedataformatfactory.cpp:12
QcepImageDataFormatBase::name
QString name() const
Definition:
qcepimagedataformat.h:32
QcepImageDataFormatBase::mkPath
void mkPath(QString filePath)
Definition:
qcepimagedataformat.cpp:6
QcepImageDataFormat::QcepImageDataFormat
QcepImageDataFormat(QString fmtname)
Definition:
qcepimagedataformat.cpp:41
QcepImageDataFormat
Definition:
qcepimagedataformat-ptr.h:4
QcepImageDataFormatBase
Definition:
qcepimagedataformat.h:11
Generated by
1.8.10