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
2df9e0c3
Commit
2df9e0c3
authored
Dec 15, 2009
by
Mark Olesen
Browse files
Add very rudimentary output support for wide-characters.
parent
bf2865a0
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/Make/files
View file @
2df9e0c3
...
...
@@ -10,7 +10,9 @@ $(bools)/bool/boolIO.C
$(bools)/Switch/Switch.C
$(bools)/Switch/SwitchIO.C
primitives/char/charIO.C
chars = primitives/chars
$(chars)/char/charIO.C
$(chars)/wchar/wcharIO.C
ints = primitives/ints
$(ints)/int/intIO.C
...
...
src/OpenFOAM/primitives/char/char.H
→
src/OpenFOAM/primitives/
chars/
char/char.H
View file @
2df9e0c3
File moved
src/OpenFOAM/primitives/char/charIO.C
→
src/OpenFOAM/primitives/
chars/
char/charIO.C
View file @
2df9e0c3
File moved
src/OpenFOAM/primitives/chars/wchar/wchar.H
0 → 100644
View file @
2df9e0c3
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Primitive
wchar_t
Description
A wide-character and a pointer to a wide-character string.
SourceFiles
wcharIO.C
\*---------------------------------------------------------------------------*/
#ifndef wchar_H
#define wchar_H
#include
<cwchar>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace
Foam
{
class
Istream
;
class
Ostream
;
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
//- Output via a normal char
Ostream
&
operator
<<
(
Ostream
&
,
const
wchar_t
);
//- Output string via normal char
Ostream
&
operator
<<
(
Ostream
&
,
const
wchar_t
*
);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
}
// End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //
src/OpenFOAM/primitives/chars/wchar/wcharIO.C
0 → 100644
View file @
2df9e0c3
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
Reads a char from an input stream, for a given version
number and File format. If an ascii File is being read, then the line
numbers are counted and an erroneous read is reported.
\*---------------------------------------------------------------------------*/
#include
"error.H"
#include
"wchar.H"
#include
"IOstreams.H"
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
Foam
::
Ostream
&
Foam
::
operator
<<
(
Ostream
&
os
,
const
wchar_t
wc
)
{
os
.
write
(
char
(
wc
));
os
.
check
(
"Ostream& operator<<(Ostream&, const wchar_t)"
);
return
os
;
}
Foam
::
Ostream
&
Foam
::
operator
<<
(
Ostream
&
os
,
const
wchar_t
*
ws
)
{
if
(
ws
)
{
for
(
const
wchar_t
*
p
=
ws
;
*
p
;
++
p
)
{
os
.
write
(
char
(
*
p
));
}
}
os
.
check
(
"Ostream& operator<<(Ostream&, const wchar_t*)"
);
return
os
;
}
// ************************************************************************* //
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