Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
a53b4735
Commit
a53b4735
authored
Jan 11, 2009
by
Mark Olesen
Browse files
rename Foam::size() -> Foam::fileSize() for carity
parent
179ef86b
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/OSspecific/Unix/Unix.C
View file @
a53b4735
...
...
@@ -491,7 +491,7 @@ bool Foam::dir(const fileName& name)
// Return size of file
off_t
Foam
::
s
ize
(
const
fileName
&
name
)
off_t
Foam
::
fileS
ize
(
const
fileName
&
name
)
{
fileStat
fileStatus
(
name
);
if
(
fileStatus
.
isValid
())
...
...
@@ -541,7 +541,7 @@ Foam::fileNameList Foam::readDir
// Setup empty string list MAXTVALUES long
fileNameList
dirEntries
(
maxNnames
);
// Pointers to the
Unix
director
system
// Pointers to the director
y entries
DIR
*
source
;
struct
dirent
*
list
;
...
...
@@ -806,7 +806,7 @@ bool Foam::rmDir(const fileName& directory)
<<
"removing directory "
<<
directory
<<
endl
;
}
// Pointers to the
Unix
director
system
// Pointers to the director
y entries
DIR
*
source
;
struct
dirent
*
list
;
...
...
src/OpenFOAM/include/OSspecific.H
View file @
a53b4735
...
...
@@ -26,7 +26,7 @@ InNamespace
Foam
Description
Functions used by OpenFOAM
which
are specific to the UNIX operating system
Functions used by OpenFOAM
that
are specific to the UNIX operating system
and need to be replaced or emulated on other systems.
SourceFiles
...
...
@@ -118,7 +118,7 @@ mode_t mode(const fileName&);
//- Return the file type: FILE or DIRECTORY
fileName
::
Type
type
(
const
fileName
&
);
//- Does the name exist in the fil
ing
system?
//- Does the name exist in the fil
e
system?
bool
exists
(
const
fileName
&
name
);
//- Does the file exist?
...
...
@@ -128,7 +128,7 @@ bool file(const fileName&);
bool
dir
(
const
fileName
&
);
//- Return size of file
off_t
s
ize
(
const
fileName
&
);
off_t
fileS
ize
(
const
fileName
&
);
//- Return time of last file modification
time_t
lastModified
(
const
fileName
&
);
...
...
src/surfMesh/surfaceFormats/stl/STLsurfaceFormatASCII.L
View file @
a53b4735
...
...
@@ -405,12 +405,12 @@ endsolid {space}("endsolid"|"ENDSOLID")({some_space}{word})*
bool Foam::fileFormats::STLsurfaceFormatCore::readASCII
(
IFstream& ifs,
const off_t
f
ileSize
const off_t
dataF
ileSize
)
{
// Create the lexer with the approximate number of vertices in the STL
// from the file size
STLASCIILexer lexer(&ifs.stdStream(),
f
ileSize/400);
STLASCIILexer lexer(&ifs.stdStream(),
dataF
ileSize/400);
while (lexer.lex() != 0) {}
sorted_ = lexer.sorted();
...
...
src/surfMesh/surfaceFormats/stl/STLsurfaceFormatCore.C
View file @
a53b4735
...
...
@@ -45,7 +45,7 @@ int Foam::fileFormats::STLsurfaceFormatCore::detectBINARY
const
fileName
&
filename
)
{
off_t
f
ileSize
=
Foam
::
s
ize
(
filename
);
off_t
dataF
ileSize
=
Foam
::
fileS
ize
(
filename
);
IFstream
ifs
(
filename
,
IOstream
::
BINARY
);
istream
&
is
=
ifs
.
stdStream
();
...
...
@@ -74,8 +74,8 @@ int Foam::fileFormats::STLsurfaceFormatCore::detectBINARY
(
!
is
||
nTris
<
0
||
nTris
<
(
f
ileSize
-
headerSize
)
/
50
||
nTris
>
(
f
ileSize
-
headerSize
)
/
25
||
nTris
<
(
dataF
ileSize
-
headerSize
)
/
50
||
nTris
>
(
dataF
ileSize
-
headerSize
)
/
25
)
{
return
0
;
...
...
@@ -89,7 +89,7 @@ int Foam::fileFormats::STLsurfaceFormatCore::detectBINARY
bool
Foam
::
fileFormats
::
STLsurfaceFormatCore
::
readBINARY
(
IFstream
&
ifs
,
const
off_t
f
ileSize
const
off_t
dataF
ileSize
)
{
sorted_
=
true
;
...
...
@@ -124,8 +124,8 @@ bool Foam::fileFormats::STLsurfaceFormatCore::readBINARY
(
!
is
||
nTris
<
0
||
nTris
<
(
f
ileSize
-
headerSize
)
/
50
||
nTris
>
(
f
ileSize
-
headerSize
)
/
25
||
nTris
<
(
dataF
ileSize
-
headerSize
)
/
50
||
nTris
>
(
dataF
ileSize
-
headerSize
)
/
25
)
{
FatalErrorIn
...
...
@@ -224,16 +224,16 @@ Foam::fileFormats::STLsurfaceFormatCore::STLsurfaceFormatCore
names_
(
0
),
sizes_
(
0
)
{
off_t
f
ileSize
=
Foam
::
s
ize
(
filename
);
off_t
dataF
ileSize
=
Foam
::
fileS
ize
(
filename
);
// auto-detect ascii/binary
if
(
detectBINARY
(
filename
))
{
readBINARY
(
IFstream
(
filename
,
IOstream
::
BINARY
)(),
f
ileSize
);
readBINARY
(
IFstream
(
filename
,
IOstream
::
BINARY
)(),
dataF
ileSize
);
}
else
{
readASCII
(
IFstream
(
filename
)(),
f
ileSize
);
readASCII
(
IFstream
(
filename
)(),
dataF
ileSize
);
}
}
...
...
src/triSurface/triSurface/interfaces/STL/readSTLASCII.L
View file @
a53b4735
/*--------------------------------
---------
----------------------------------*\
/*--------------------------------
*- C++ -*
----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
...
...
@@ -398,7 +398,7 @@ bool triSurface::readSTLASCII(const fileName& STLfileName)
// Create the lexer obtaining the approximate number of vertices in the STL
// from the file size
STLLexer lexer(&STLstream.stdStream(), Foam::
s
ize(STLfileName)/400);
STLLexer lexer(&STLstream.stdStream(), Foam::
fileS
ize(STLfileName)/400);
while(lexer.lex() != 0)
{}
...
...
src/triSurface/triSurface/interfaces/STL/readSTLBINARY.C
View file @
a53b4735
...
...
@@ -89,9 +89,9 @@ bool triSurface::readSTLBINARY(const fileName& STLfileName)
// If the comparison is not sensible then it maybe an ASCII file
if
(
!
compressed
)
{
label
triData
Size
=
Foam
::
s
ize
(
STLfileName
)
-
80
;
label
dataFile
Size
=
Foam
::
fileS
ize
(
STLfileName
)
-
80
;
if
(
nTris
<
triData
Size
/
50
||
nTris
>
triData
Size
/
25
)
if
(
nTris
<
dataFile
Size
/
50
||
nTris
>
dataFile
Size
/
25
)
{
return
false
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment