inline functions

This commit is contained in:
Maxime Gimeno 2020-01-28 12:09:52 +01:00
parent 88e9727717
commit fe252ae596
1 changed files with 11 additions and 11 deletions

View File

@ -397,7 +397,7 @@ returns the printing mode of the %IO stream `s`.
\sa `CGAL::is_binary()` \sa `CGAL::is_binary()`
\sa `CGAL::is_pretty()` \sa `CGAL::is_pretty()`
*/ */
CGAL_EXPORT IO::Mode get_mode(std::ios& i) { return static_cast<IO::Mode>(i.iword(IO::Static::get_mode())); } CGAL_EXPORT inline IO::Mode get_mode(std::ios& i) { return static_cast<IO::Mode>(i.iword(IO::Static::get_mode())); }
/*! /*!
\ingroup PkgStreamSupportRef \ingroup PkgStreamSupportRef
@ -414,7 +414,7 @@ Returns the previous mode of `s`.
\sa `CGAL::is_binary()` \sa `CGAL::is_binary()`
\sa `CGAL::is_pretty()` \sa `CGAL::is_pretty()`
*/ */
CGAL_EXPORT IO::Mode set_ascii_mode(std::ios& i) CGAL_EXPORT inline IO::Mode set_ascii_mode(std::ios& i)
{ {
IO::Mode m = get_mode(i); IO::Mode m = get_mode(i);
i.iword(IO::Static::get_mode()) = IO::ASCII; i.iword(IO::Static::get_mode()) = IO::ASCII;
@ -436,7 +436,7 @@ Returns the previous mode of `s`.
\sa `CGAL::is_binary()` \sa `CGAL::is_binary()`
\sa `CGAL::is_pretty()` \sa `CGAL::is_pretty()`
*/ */
CGAL_EXPORT IO::Mode set_binary_mode(std::ios& i) CGAL_EXPORT inline IO::Mode set_binary_mode(std::ios& i)
{ {
IO::Mode m = get_mode(i); IO::Mode m = get_mode(i);
i.iword(IO::Static::get_mode()) = IO::BINARY; i.iword(IO::Static::get_mode()) = IO::BINARY;
@ -458,7 +458,7 @@ Returns the previous mode of `s`.
\sa `CGAL::is_binary()` \sa `CGAL::is_binary()`
\sa `CGAL::is_pretty()` \sa `CGAL::is_pretty()`
*/ */
CGAL_EXPORT IO::Mode set_pretty_mode(std::ios& i) //@todo export ? CGAL_EXPORT inline IO::Mode set_pretty_mode(std::ios& i) //@todo export ?
{ {
IO::Mode m = get_mode(i); IO::Mode m = get_mode(i);
i.iword(IO::Static::get_mode()) = IO::PRETTY; i.iword(IO::Static::get_mode()) = IO::PRETTY;
@ -479,7 +479,7 @@ sets the printing mode of the %IO stream `s`.
\sa `CGAL::is_binary()` \sa `CGAL::is_binary()`
\sa `CGAL::is_pretty()` \sa `CGAL::is_pretty()`
*/ */
CGAL_EXPORT IO::Mode set_mode(std::ios& i, IO::Mode m) CGAL_EXPORT inline IO::Mode set_mode(std::ios& i, IO::Mode m)
{ {
IO::Mode old = get_mode(i); IO::Mode old = get_mode(i);
i.iword(IO::Static::get_mode()) = m; i.iword(IO::Static::get_mode()) = m;
@ -500,7 +500,7 @@ checks if the %IO stream `s` is in `IO::PRETTY` mode.
\sa `CGAL::is_ascii()` \sa `CGAL::is_ascii()`
\sa `CGAL::is_binary()` \sa `CGAL::is_binary()`
*/ */
bool is_pretty(std::ios& i) { return i.iword(IO::Static::get_mode()) == IO::PRETTY; } inline bool is_pretty(std::ios& i) { return i.iword(IO::Static::get_mode()) == IO::PRETTY; }
/*! /*!
\ingroup PkgStreamSupportRef \ingroup PkgStreamSupportRef
@ -516,7 +516,7 @@ checks if the %IO stream `s` is in `IO::ASCII` mode.
\sa `CGAL::is_binary()` \sa `CGAL::is_binary()`
\sa `CGAL::is_pretty()` \sa `CGAL::is_pretty()`
*/ */
bool is_ascii(std::ios& i) { return i.iword(IO::Static::get_mode()) == IO::BINARY; } inline bool is_ascii(std::ios& i) { return i.iword(IO::Static::get_mode()) == IO::BINARY; }
/*! /*!
\ingroup PkgStreamSupportRef \ingroup PkgStreamSupportRef
@ -532,7 +532,7 @@ checks if the %IO stream `s` is in `IO::BINARY` mode.
\sa `CGAL::is_ascii()` \sa `CGAL::is_ascii()`
\sa `CGAL::is_pretty()` \sa `CGAL::is_pretty()`
*/ */
bool is_binary(std::ios& i) { return i.iword(IO::Static::get_mode()) == IO::BINARY; } inline bool is_binary(std::ios& i) { return i.iword(IO::Static::get_mode()) == IO::BINARY; }
template < class T > template < class T >
inline void write(std::ostream& os, const T& t, const io_Read_write&) inline void write(std::ostream& os, const T& t, const io_Read_write&)
@ -632,7 +632,7 @@ inline std::istream &operator>>(std::istream &is, Color& col)
return is; return is;
} }
const char* mode_name( IO::Mode m ) inline const char* mode_name( IO::Mode m )
{ {
static const char* const names[] = {"ASCII", "PRETTY", "BINARY" }; static const char* const names[] = {"ASCII", "PRETTY", "BINARY" };
CGAL_assertion( IO::ASCII <= m && m <= IO::BINARY ); CGAL_assertion( IO::ASCII <= m && m <= IO::BINARY );
@ -640,7 +640,7 @@ const char* mode_name( IO::Mode m )
} }
// From polynomial.h TODO: Where to put this? // From polynomial.h TODO: Where to put this?
void swallow(std::istream &is, char d) inline void swallow(std::istream &is, char d)
{ {
char c; char c;
do { is.get(c); } while(isspace(c)); do { is.get(c); } while(isspace(c));
@ -652,7 +652,7 @@ void swallow(std::istream &is, char d)
} }
} }
void swallow(std::istream &is, const std::string& s) inline void swallow(std::istream &is, const std::string& s)
{ {
std::string t; std::string t;
is >> t; is >> t;