Skip to content
Snippets Groups Projects
Commit 24c2d552 authored by Jan Trávníček's avatar Jan Trávníček
Browse files

change std::cout to common::Streams::out

parent 63f2eee8
No related branches found
No related tags found
No related merge requests found
Showing
with 43 additions and 43 deletions
......@@ -215,7 +215,7 @@ int main ( int argc, char * argv[] ) {
alib::XmlDataFactory::toStdout ( exception );
return 1;
} catch ( const TCLAP::ArgException & exception ) {
std::cout << exception.error ( ) << std::endl;
common::Streams::out << exception.error ( ) << std::endl;
return 2;
} catch ( const std::exception & exception ) {
common::Streams::err << "Exception caught: " << exception.what ( ) << std::endl;
......
......@@ -228,7 +228,7 @@ int main ( int argc, char * argv[] ) {
alib::XmlDataFactory::toStdout ( exception );
return 1;
} catch ( const TCLAP::ArgException & exception ) {
std::cout << exception.error ( ) << std::endl;
common::Streams::out << exception.error ( ) << std::endl;
return 2;
} catch ( const std::exception & exception ) {
common::Streams::err << "Exception caught: " << exception.what ( ) << std::endl;
......
......@@ -67,7 +67,7 @@ int main(int argc, char** argv) {
alib::XmlDataFactory::toStdout(exception);
return 1;
} catch(const TCLAP::ArgException& exception) {
std::cout << exception.error() << std::endl;
common::Streams::out << exception.error() << std::endl;
return 2;
} catch(...) {
return 127;
......
......@@ -80,7 +80,7 @@ int main ( int argc, char * * argv ) {
std::string result = std::dynamic_pointer_cast < abstraction::ValueProvider < std::string > > ( environment.getVariable ( "output" ) )->getValue ( true );
 
if ( result != "" )
std::cout << result << std::endl;
common::Streams::out << result << std::endl;
 
measurements::end ( );
measurements::end ( );
......
......@@ -96,7 +96,7 @@ int main(int argc, char** argv) {
alib::XmlDataFactory::toStdout(exception);
return 1;
} catch(const TCLAP::ArgException& exception) {
std::cout << exception.error() << std::endl;
common::Streams::out << exception.error() << std::endl;
return 2;
} catch (const std::exception& exception) {
common::Streams::err << "Exception caught: " << exception.what() << std::endl;
......
......@@ -106,7 +106,7 @@ int main ( int argc, char * argv[] ) {
alib::XmlDataFactory::toStdout ( exception );
return 1;
} catch ( const TCLAP::ArgException & exception ) {
std::cout << exception.error ( ) << std::endl;
common::Streams::out << exception.error ( ) << std::endl;
return 2;
} catch ( const std::exception & exception ) {
common::Streams::err << "Exception caught: " << exception.what ( ) << std::endl;
......
......@@ -75,7 +75,7 @@ int main(int argc, char** argv) {
alib::XmlDataFactory::toStdout(exception);
return 1;
} catch(const TCLAP::ArgException& exception) {
std::cout << exception.error() << std::endl;
common::Streams::out << exception.error() << std::endl;
return 2;
} catch (const std::exception& exception) {
common::Streams::err << "Exception caught: " << exception.what() << std::endl;
......
......@@ -107,7 +107,7 @@ int main(int argc, char* argv[]) {
alib::XmlDataFactory::toStdout( exception );
return 1;
} catch(const TCLAP::ArgException& exception) {
std::cout << exception.error() << std::endl;
common::Streams::out << exception.error() << std::endl;
return 2;
} catch (const std::exception& exception) {
common::Streams::err << "Exception caught: " << exception.what() << std::endl;
......
......@@ -21,7 +21,7 @@ DefaultStateType createDFAState ( ext::set < DefaultStateType > nfaStates ) {
}
 
const ext::set < DefaultStateType > & recreateNFAStates ( const DefaultStateType & dfaState ) {
// std::cout << dfaState << std::endl;
// common::Streams::out << dfaState << std::endl;
return static_cast < const DefaultStatesSetType & > ( dfaState.getData ( ) );
}
 
......
......@@ -877,10 +877,10 @@ bool RegExpOptimize::V9( UnboundedRegExpConcatenation < SymbolType > & node ) {
continue;
}
 
// std::cout << "xy" << std::endl;
// common::Streams::out << "xy" << std::endl;
// UnboundedRegExpConcatenation < SymbolType >* tmp = new UnboundedRegExpConcatenation < SymbolType >( );
// tmp->insert( tmp->getChildren().end( ), std::next( it ), c1Iter );
// std::cout << RegExp( tmp ) << std::endl;
// common::Streams::out << RegExp( tmp ) << std::endl;
 
// copy the range <it;sth>, delete it and go back to the iter node
ext::vector<ext::smart_ptr < UnboundedRegExpElement < SymbolType > > > copyRange;
......
......@@ -47,9 +47,9 @@ ext::map<SymbolType, size_t> BadCharacterShiftTable::bcs(const string::LinearStr
 
/*
for(const auto& kv: bcs)
std::cout << std::string(kv.first) << " " << kv.second << std::endl;
common::Streams::out << std::string(kv.first) << " " << kv.second << std::endl;
for(const auto& s: string.getContent())
std::cout << std::string(s);std::cout << std::endl;
common::Streams::out << std::string(s);common::Streams::out << std::endl;
*/
 
return bcs;
......
......@@ -56,7 +56,7 @@ ext::set<unsigned> BoyerMoore::match(const string::LinearString < SymbolType >&
// Yay, there is match!!!
if(i == 0) occ.insert(haystack_offset);
haystack_offset += std::max ( bcs[string.getContent()[haystack_offset + pattern.getContent().size() - 1]], gss [ pattern.getContent ( ).size ( ) - i ] );
//std::cout << haystack_offset << std::endl;
//common::Streams::out << haystack_offset << std::endl;
}
measurements::end ( );
 
......
......@@ -54,7 +54,7 @@ ext::set<unsigned> BoyerMooreHorspool::match(const string::LinearString < Symbol
// Yay, there is match!!!
if(i == 0) occ.insert(haystack_offset);
haystack_offset += bcs[string.getContent()[haystack_offset + pattern.getContent().size() - 1]];
//std::cout << haystack_offset << std::endl;
//common::Streams::out << haystack_offset << std::endl;
}
measurements::end ( );
 
......
......@@ -52,7 +52,7 @@ ext::set < unsigned > ReversedBoyerMooreHorspool::match ( const string::LinearSt
 
haystack_offset -= bcs[string.getContent ( )[haystack_offset]];
 
// std::cout << haystack_offset << std::endl;
// common::Streams::out << haystack_offset << std::endl;
}
 
return occ;
......
......@@ -183,7 +183,7 @@ struct Node {
}
}
 
void nicePrint ( std::ostream & os = std::cout, const std::string & prefix = "", const bool last = true ) const {
void nicePrint ( std::ostream & os = common::Streams::out, const std::string & prefix = "", const bool last = true ) const {
os << prefix;
 
std::string nextPrefix ( prefix );
......
......@@ -17,7 +17,7 @@
#include "../datastructs/Array.h"
 
#ifndef NDEBUG
#define GEN_GRAPH(x) std::cout << x << std::endl;
#define GEN_GRAPH(x) common::Streams::out << x << std::endl;
#else
#define GEN_GRAPH(x)
#endif
......
......@@ -11,7 +11,7 @@
#ifndef NDEBUG
#include <cassert>
#define H_ASSERT(x) assert(x)
#define H_DEBUG(x) std::cout << std::boolalpha << x << std::endl
#define H_DEBUG(x) common::Streams::out << std::boolalpha << x << std::endl
#else
#define H_ASSERT(x)
#define H_DEBUG(str)
......
......@@ -530,39 +530,39 @@ void Graph::init(const UndirectedGraph &graph)
 
void Graph::dump()
{
std::cout << std::endl;
std::cout << "Vertices: " << vertices.size();
std::cout << " Edges: " << edge_ends.size() / 2;
std::cout << std::endl;
common::Streams::out << std::endl;
common::Streams::out << "Vertices: " << vertices.size();
common::Streams::out << " Edges: " << edge_ends.size() / 2;
common::Streams::out << std::endl;
for (Vertex *v : vertices) {
std::cout << v->dump() << "(" << v->degree << "):";
common::Streams::out << v->dump() << "(" << v->degree << "):";
v->forEachEdge([this](EdgeEnd *e) {
std::cout << e->dump() << " (" << std::distance(edge_ends.begin(), std::find(edge_ends.begin(), edge_ends.end(), e)) << ")";
common::Streams::out << e->dump() << " (" << std::distance(edge_ends.begin(), std::find(edge_ends.begin(), edge_ends.end(), e)) << ")";
return true;
});
std::cout << std::endl;
common::Streams::out << std::endl;
}
std::cout << std::endl;
common::Streams::out << std::endl;
}
 
void Graph::dumpLabels()
{
std::cout << std::endl;
std::cout << "Vertices:" << std::endl;
common::Streams::out << std::endl;
common::Streams::out << "Vertices:" << std::endl;
for (Vertex *v : vertices)
std::cout << " " << v->vlabel;
std::cout << std::endl;
common::Streams::out << " " << v->vlabel;
common::Streams::out << std::endl;
 
std::cout << "Edges:" << std::endl;
common::Streams::out << "Edges:" << std::endl;
for (Vertex *v : vertices) {
std::cout << v->dump() << ":";
common::Streams::out << v->dump() << ":";
v->forEachEdge([](EdgeEnd *e) {
std::cout << " " << e->elabel << "-" << e->otheredge->elabel;
common::Streams::out << " " << e->elabel << "-" << e->otheredge->elabel;
return true;
});
std::cout << std::endl;
common::Streams::out << std::endl;
}
std::cout << std::endl;
common::Streams::out << std::endl;
}
 
Vertex::Vertex()
......
......@@ -1484,19 +1484,19 @@ bool HopcroftImpl::isomorphism_mapping(ext::unordered_map<Vertex*, Vertex*> &map
 
void HopcroftImpl::dumpGraphs()
{
std::cout << "G1:";
common::Streams::out << "G1:";
m_g1->dump();
 
std::cout << "G2:";
common::Streams::out << "G2:";
m_g2->dump();
}
 
void HopcroftImpl::dumpLabels()
{
std::cout << "G1:";
common::Streams::out << "G1:";
m_g1->dumpLabels();
 
std::cout << "G2:";
common::Streams::out << "G2:";
m_g2->dumpLabels();
}
 
......
......@@ -20,17 +20,17 @@ namespace dataAccess {
 
void ExceptionAccess::access ( const exception::CommonException & exception, const ExceptionSettings::Settings & settings, const OperationSettings::Settings & operation ) {
if ( settings == ExceptionSettings::Settings::CAUSE && operation == OperationSettings::Settings::GET ) {
std::cout << exception.getCause ( );
common::Streams::out << exception.getCause ( );
return;
}
 
if ( settings == ExceptionSettings::Settings::BACKTRACE && operation == OperationSettings::Settings::GET ) {
std::cout << exception.getBacktrace ( );
common::Streams::out << exception.getBacktrace ( );
return;
}
 
if ( settings == ExceptionSettings::Settings::COMMAND && operation == OperationSettings::Settings::GET ) {
std::cout << exception.getCommand ( );
common::Streams::out << exception.getCommand ( );
return;
}
 
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment