/* * * This file and its contents are the property of The MathWorks, Inc. * * This file contains confidential proprietary information. * The reproduction, distribution, utilization or the communication * of this file or any part thereof is strictly prohibited. * Offenders will be held liable for the payment of damages. * * Copyright 1999-2012 The MathWorks, Inc. * */ #ifndef PST_STL_OSTREAM #define PST_STL_OSTREAM #include #include #include namespace std { #ifdef PST_VISUAL #pragma pack(push, 8) /* push default value */ #endif template class basic_ostream : virtual public basic_ios { public: // typedef __ps_typename traits::off_type streamsize; typedef charT char_type; typedef __ps_typename traits::int_type int_type; typedef __ps_typename traits::pos_type pos_type; typedef __ps_typename traits::off_type off_type; typedef traits traits_type; typedef basic_ostream& (*__omanip)(basic_ostream &); typedef basic_ios& (*__manip)(basic_ios &); typedef ios_base& (*__iosmanip)(ios_base &); // Constructors and destructors // __ps_explicit basic_ostream(basic_streambuf *); #ifdef PST_VISUAL basic_ostream(basic_streambuf *, __ps_bool){} /* _Uninitialized is declared in xstddef which is always included by polyspace_std_decl.h */ basic_ostream(_Uninitialized){} #endif basic_ostream(){} ~basic_ostream(); #ifdef PST_VISUAL __ps_bool opfx() { volatile __ps_bool random = false; return random; } __ps_bool osfx() { volatile __ps_bool random = false; return random; } #endif // Formatted output // basic_ostream &operator << (__omanip); basic_ostream &operator << (__manip); basic_ostream &operator << (__iosmanip); #ifdef _BOOL basic_ostream &operator << (__ps_bool); #endif /* _BOOL */ basic_ostream &operator << (short); basic_ostream &operator << (unsigned short); basic_ostream &operator << (int); basic_ostream &operator << (unsigned int); basic_ostream &operator << (long); basic_ostream &operator << (unsigned long); basic_ostream &operator << (long long); basic_ostream &operator << (unsigned long long); basic_ostream &operator << (float); basic_ostream &operator << (double); basic_ostream &operator << (long double); basic_ostream &operator << (const void *); basic_ostream &operator << (basic_streambuf *); // PST specific : requirements on basic_ostream &operator << (__pst_smanip_typ) { return *this ; } ; // Unformatted output // basic_ostream &put(char_type c); basic_ostream &write(const char_type *s, streamsize n); #ifdef PST_STL_PERMISSIVE_STUB basic_ostream &write(const unsigned char*s, streamsize n) { for (streamsize i = 0; i < n; i++) s[i]; return (*this); } basic_ostream &write(const signed char*s, streamsize n) { for (streamsize i = 0; i < n; i++) s[i]; return (*this); } #endif /* PST_STL_PERMISSIVE_STUB */ basic_ostream &flush(); // Seeks // pos_type tellp(); basic_ostream &seekp(pos_type); basic_ostream &seekp(off_type, ios_base::seekdir); }; /* __ps_explicit basic_ostream (basic_streambuf *) This constructor create the out stream. */ template< class charT, class traits > basic_ostream::basic_ostream(basic_streambuf *) {} /* ~basic_ostream () This destructor destroy the out stream. */ template < class charT, class traits > basic_ostream::~basic_ostream() {} /* basic_ostream& operator << (__omanip); Comment : Call the function of __omanip type and returns the in stream. */ template < class charT, class traits > basic_ostream& basic_ostream::operator << (__omanip func) { return ((*func)(*this)); } /* basic_ostream& operator << (__manip); Comment : Call the function of __manip type and returns the in stream. */ template < class charT, class traits > basic_ostream& basic_ostream::operator << (__manip func) { return (*this); } /* basic_ostream& operator << (__iosmanip); Comment : Call the function of __manip type and returns the in stream. */ template < class charT, class traits > basic_ostream& basic_ostream::operator << (__iosmanip func) { return (*this); } #ifdef _BOOL /* basic_ostream& operator << (__ps_bool); Comment : Put a __ps_bool in the out stream. */ template < class charT, class traits > basic_ostream& basic_ostream::operator << (__ps_bool b) { return (*this); } #endif /* _BOOL */ /* basic_ostream& operator << (short); Comment : Put an integer (short) in the out stream. */ template < class charT, class traits > basic_ostream& basic_ostream::operator << (short n) { return (*this); } /* basic_ostream& operator << (unsigned short); Comment : Put an integer (short and unsigned) in the out stream. */ template < class charT, class traits > basic_ostream& basic_ostream::operator << (unsigned short n) { return (*this); } /* basic_ostream& operator << (int); Comment : Put an integer in the out stream. */ template < class charT, class traits > basic_ostream& basic_ostream::operator << (int n) { return (*this); } /* basic_ostream& operator << (unsigned int); Comment : Put an integer (unsigned) in the out stream. */ template < class charT, class traits > basic_ostream& basic_ostream::operator << (unsigned int n) { return (*this); } /* basic_ostream& operator << (long); Comment : Put an integer (long) in the out stream. */ template < class charT, class traits > basic_ostream& basic_ostream::operator << (long n) { return (*this); } /* basic_ostream& operator << (unsigned long); Comment : Put an integer (unsigned and long) in the out stream. */ template < class charT, class traits > basic_ostream& basic_ostream::operator << (unsigned long b) { return (*this); } template < class charT, class traits > basic_ostream& basic_ostream::operator << (long long) { return (*this); } template < class charT, class traits > basic_ostream& basic_ostream::operator << (unsigned long long) { return (*this); } /* basic_ostream& operator << (float); Comment : Put a real(simple precision) in the out stream. */ template < class charT, class traits > basic_ostream& basic_ostream::operator << (float r) { return (*this); } /* basic_ostream& operator << (double); Comment : Put a real (double precision) in the out stream. */ template < class charT, class traits > basic_ostream& basic_ostream::operator << (double r) { return (*this); } /* basic_ostream& operator << (long double); Comment : Put a real(long and double precision) in the out stream. */ template < class charT, class traits > basic_ostream& basic_ostream::operator << (long double r) { return (*this); } /* basic_ostream& operator << (const void *); Comment : Put an address in the out stream. */ template < class charT, class traits > basic_ostream& basic_ostream::operator << (const void *add) { return (*this); } /* basic_ostream& operator << (basic_streambuf *); Comment : Put a buffer in the out stream. */ template < class charT, class traits > basic_ostream& basic_ostream::operator << (basic_streambuf *sb) { return (*this); } /* basic_ostream& put (char_type c); Comment : Put a character in the out stream. */ template < class charT, class traits > basic_ostream& basic_ostream::put(char_type c) { return (*this); } /* basic_ostream& write (const char_type *s, streamsize n); Comment : Put a string of characters in the out stream. */ template < class charT, class traits > basic_ostream& basic_ostream::write(const char_type *s, streamsize n) { int i; for (i = 0; i < n; i++) s[i]; return (*this); } template < class charT, class traits > basic_ostream& basic_ostream::flush() { return (*this); } /* pos_type tellp(); Comment : return the pos_type of the pointer in the buffer. */ template < class charT, class traits > basic_ostream::pos_type basic_ostream::tellp() { //volatile pos_type ret=pos_type(); return (ret); } /* basic_ostream &seekp(pos_type) Comment : return the stream. */ template basic_ostream &basic_ostream::seekp(pos_type pos) { return (*this); } /* basic_ostream &seekp(off_type, ios_base::seekdir) Comment : return the stream. */ template basic_ostream &basic_ostream::seekp(off_type of, ios_base::seekdir dir) { return (*this); } /* basic_ostream &operator << (basic_ostream &, charT) Comment : Put a character in the out stream. */ template basic_ostream &operator << (basic_ostream &os, charT c) { return (os); } /* basic_ostream &operator << (basic_ostream &, char) Comment : Put a character in the out stream. */ template basic_ostream &operator << (basic_ostream &os, char c) { return (os); } /* basic_ostream &operator << (basic_ostream &, char) Comment : Put a character in the out stream. */ template basic_ostream &operator << (basic_ostream &os, char c) { return (os); } /* basic_ostream &operator << (basic_ostream &, signed char) Comment : Put a character (signed )in the out stream. */ template basic_ostream &operator << (basic_ostream &os, signed char c) { return (os); } /* basic_ostream &operator << (basic_ostream &, unsigned char) Comment : Put a character (unsigned) in the out stream. */ template basic_ostream &operator << (basic_ostream &os, unsigned char c) { return (os); } /* basic_ostream &operator << (basic_ostream &, const charT *) Comment : Put a string of character in the out stream. */ template basic_ostream &operator << (basic_ostream &os, const charT *str) { while (*str != '\0') str++; return (os); } /* basic_ostream &operator << (basic_ostream &, const char *) Comment : Put a string of character in the out stream. */ template basic_ostream &operator << (basic_ostream &os, const char *str) { while (*str != '\0') str++; return (os); } /* basic_ostream &operator << (basic_ostream &, const char *) Comment : Put a string of character in the out stream. */ template basic_ostream &operator << (basic_ostream &os, const char *str) { while (*str != '\0') str++; return (os); } /* basic_ostream &operator << (basic_ostream &, const signed char *) Comment : Put a string of character (signed) in the out stream. */ template basic_ostream &operator << (basic_ostream &os, const signed char *str) { while (*str != '\0') str++; return (os); } /* basic_ostream &operator << (basic_ostream &, const unsigned char *) Comment : Put a string of character (unsigned) in the out stream. */ template basic_ostream &operator << (basic_ostream &os, const unsigned char *str) { while (*str != '\0') str++; return (os); } template basic_ostream &endl(basic_ostream &os) {return os;} template basic_ostream &ends(basic_ostream &os) {return os;} template basic_ostream &flush(basic_ostream &os) {return os;} #ifdef PST_VISUAL #pragma pack(pop) /* pop back to previous value */ #endif } #ifdef __PST_IMPLICIT_USING_STD /* Implicitly include a using directive for the STD namespace when this preprocessing flag is TRUE. */ using namespace std; #endif /* ifdef __PST_IMPLICIT_USING_STD */ #endif