Skip to content

Commit

Permalink
Solving boost namespace ambiguity
Browse files Browse the repository at this point in the history
Change-Id: I05631c79fc873d34e8e264c8ef3aeeeba49cc528
  • Loading branch information
cawka committed Apr 5, 2011
1 parent 40f5a79 commit 7e1d102
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
8 changes: 4 additions & 4 deletions dumper/mrt2xml.cpp
Expand Up @@ -88,10 +88,10 @@ namespace fs = boost::filesystem;
#include <boost/scoped_array.hpp>

#include <boost/iostreams/categories.hpp>
namespace io = boost::iostreams;

using namespace std;
using namespace boost;
using namespace boost::iostreams;

//int dump_type = 0; // 1: TABLE_DUMP1
// // 2: TABLE_DUMP2
Expand Down Expand Up @@ -221,17 +221,17 @@ int main(int argc, char** argv)
if( regex_match(string(fileName), m, regex("^.*\\.(gz|bz2)$")) ) format=m[1];
////////////////////////////////////////////////////////////////////////////

io::filtering_stream<io::input> in;
filtering_stream<input> in;

if( format=="gz" )
{
LOG4CXX_DEBUG( _log, "Input file has GZIP format" );
in.push( io::gzip_decompressor() );
in.push( gzip_decompressor() );
}
else if( format=="bz2" )
{
LOG4CXX_DEBUG( _log, "Input file has BZIP2 format" );
in.push( io::bzip2_decompressor() );
in.push( bzip2_decompressor() );
}

ifstream input_file( fileName, ios_base::in | ios_base::binary );
Expand Down
12 changes: 6 additions & 6 deletions dumper2/main.cpp
Expand Up @@ -64,10 +64,10 @@ namespace po = boost::program_options;
#include <boost/scoped_array.hpp>

#include <boost/iostreams/categories.hpp>
namespace io = boost::iostreams;

using namespace std;
using namespace boost;
using namespace boost::iostreams;

#ifdef LOG4CXX
static LoggerPtr _log=Logger::getLogger( "bgpparser" );
Expand Down Expand Up @@ -151,17 +151,17 @@ int main(int argc, char** argv)
if( regex_match(filename, m, regex("^.*\\.(gz|bz2)$")) ) format=m[1];
////////////////////////////////////////////////////////////////////////////

io::filtering_stream<io::input> in;
filtering_stream<input> in;

if( format=="gz" )
{
LOG4CXX_DEBUG( _log, "Input file has GZIP format" );
in.push( io::gzip_decompressor() );
in.push( gzip_decompressor() );
}
else if( format=="bz2" )
{
LOG4CXX_DEBUG( _log, "Input file has BZIP2 format" );
in.push( io::bzip2_decompressor() );
in.push( bzip2_decompressor() );
}

ifstream input_file( filename.c_str(), ios_base::in | ios_base::binary );
Expand Down Expand Up @@ -230,8 +230,8 @@ int main(int argc, char** argv)
LOG4CXX_DEBUG( _log, "EOF" );
; //do nothing
}
// catch( io::gzip_error e )
// catch( io::bzip2_error e )
// catch( gzip_error e )
// catch( bzip2_error e )
catch( std::istream::failure e )
{
cerr << "ERROR: " << e.what() << endl;
Expand Down
12 changes: 6 additions & 6 deletions examples/bgpparser.cpp
Expand Up @@ -66,10 +66,10 @@ namespace po = boost::program_options;
#include <boost/scoped_array.hpp>

#include <boost/iostreams/categories.hpp>
namespace io = boost::iostreams;

using namespace std;
using namespace boost;
using namespace boost::iostreams;

bool PrintCompact=false;

Expand Down Expand Up @@ -155,17 +155,17 @@ int main(int argc, char** argv)
if( regex_match(filename, m, regex("^.*\\.(gz|bz2)$")) ) format=m[1];
////////////////////////////////////////////////////////////////////////////

io::filtering_stream<io::input> in;
filtering_stream<input> in;

if( format=="gz" )
{
LOG4CXX_DEBUG( _log, "Input file has GZIP format" );
in.push( io::gzip_decompressor() );
in.push( gzip_decompressor() );
}
else if( format=="bz2" )
{
LOG4CXX_DEBUG( _log, "Input file has BZIP2 format" );
in.push( io::bzip2_decompressor() );
in.push( bzip2_decompressor() );
}

ifstream input_file( filename.c_str(), ios_base::in | ios_base::binary );
Expand Down Expand Up @@ -221,8 +221,8 @@ int main(int argc, char** argv)
LOG4CXX_DEBUG( _log, "EOF" );
; //do nothing
}
// catch( io::gzip_error e )
// catch( io::bzip2_error e )
// catch( gzip_error e )
// catch( bzip2_error e )
catch( std::istream::failure e )
{
cerr << "ERROR: " << e.what() << endl;
Expand Down

0 comments on commit 7e1d102

Please sign in to comment.