159617ebcSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
359617ebcSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
459617ebcSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
559617ebcSAndrew Rist  * distributed with this work for additional information
659617ebcSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
759617ebcSAndrew Rist  * to you under the Apache License, Version 2.0 (the
859617ebcSAndrew Rist  * "License"); you may not use this file except in compliance
959617ebcSAndrew Rist  * with the License.  You may obtain a copy of the License at
1059617ebcSAndrew Rist  *
1159617ebcSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
1259617ebcSAndrew Rist  *
1359617ebcSAndrew Rist  * Unless required by applicable law or agreed to in writing,
1459617ebcSAndrew Rist  * software distributed under the License is distributed on an
1559617ebcSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1659617ebcSAndrew Rist  * KIND, either express or implied.  See the License for the
1759617ebcSAndrew Rist  * specific language governing permissions and limitations
1859617ebcSAndrew Rist  * under the License.
1959617ebcSAndrew Rist  *
2059617ebcSAndrew Rist  *************************************************************/
2159617ebcSAndrew Rist 
2259617ebcSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #include <precomp.h>
25cdf0e10cSrcweir #include <cosv/std_outp.hxx>
26cdf0e10cSrcweir 
27cdf0e10cSrcweir // NOT FULLY DECLARED SERVICES
28cdf0e10cSrcweir #include <stdlib.h>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir 
31cdf0e10cSrcweir namespace csv
32cdf0e10cSrcweir {
33cdf0e10cSrcweir 
34cdf0e10cSrcweir #ifdef CSV_NO_IOSTREAMS
35cdf0e10cSrcweir redirect_out *  redirect_out::pStdOut_ = 0;
36cdf0e10cSrcweir redirect_out *  redirect_out::pStdErr_ = 0;
37cdf0e10cSrcweir #endif // defined(CSV_NO_IOSTREAMS)
38cdf0e10cSrcweir 
39cdf0e10cSrcweir 
40cdf0e10cSrcweir void
Endl(ostream & io_rStream,bool,int *)41cdf0e10cSrcweir Endl( ostream & io_rStream, bool /*bUseRedirect*/, int* )
42cdf0e10cSrcweir {
43cdf0e10cSrcweir #ifndef CSV_NO_IOSTREAMS
44cdf0e10cSrcweir //    if (NOT bUseRedirect)
45cdf0e10cSrcweir         io_rStream << std::endl;
46cdf0e10cSrcweir //    else
47cdf0e10cSrcweir #endif
48cdf0e10cSrcweir //        static_cast< redirect_out& >(io_rStream).re_endl();
49cdf0e10cSrcweir }
50cdf0e10cSrcweir 
51cdf0e10cSrcweir void
Flush(ostream & io_rStream,bool,int *)52cdf0e10cSrcweir Flush( ostream & io_rStream, bool /*bUseRedirect*/, int* )
53cdf0e10cSrcweir {
54cdf0e10cSrcweir #ifndef CSV_NO_IOSTREAMS
55cdf0e10cSrcweir //    if (NOT bUseRedirect)
56cdf0e10cSrcweir         io_rStream << std::flush;
57cdf0e10cSrcweir //    else
58cdf0e10cSrcweir #endif
59cdf0e10cSrcweir //        static_cast< redirect_out& >(io_rStream).re_flush();
60cdf0e10cSrcweir }
61cdf0e10cSrcweir 
62cdf0e10cSrcweir void
PerformAssertion(const char * condition,const char * file,unsigned line)63cdf0e10cSrcweir PerformAssertion(const char * condition, const char * file, unsigned line)
64cdf0e10cSrcweir {
65cdf0e10cSrcweir 	Cout() << "assertion failed: "
66cdf0e10cSrcweir 		 << condition
67cdf0e10cSrcweir 		 << " in file: "
68cdf0e10cSrcweir 		 << file
69cdf0e10cSrcweir 		 << " at line: "
70cdf0e10cSrcweir 		 << line
71cdf0e10cSrcweir 		 << Endl;
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 	exit(3);
74cdf0e10cSrcweir }
75cdf0e10cSrcweir 
76cdf0e10cSrcweir }   // namespace csv
77cdf0e10cSrcweir 
78