Move everything under a namespace

This commit is contained in:
Martchus 2022-01-18 22:08:36 +01:00
parent c96b87c60a
commit b833bfef3b
14 changed files with 28 additions and 7 deletions

View File

@ -1,5 +1,7 @@
#include "lmdb-safe.hh"
using namespace std;
using namespace LMDBSafe;
void checkLMDB(MDBEnv* env, MDBDbi dbi)
{

View File

@ -10,6 +10,8 @@
using namespace std;
namespace LMDBSafe {
static string MDBError(int rc)
{
return mdb_strerror(rc);
@ -374,3 +376,5 @@ MDBROCursor MDBROTransactionImpl::getROCursor(const MDBDbi &dbi)
}
return MDBROCursor(d_cursors, cursor);
}
}

View File

@ -15,6 +15,8 @@
#include <algorithm>
#include <limits>
namespace LMDBSafe {
// apple compiler somehow has string_view even in c++11!
#ifdef __cpp_lib_string_view
using std::string_view;
@ -620,3 +622,4 @@ public:
};
}

View File

@ -1,5 +1,7 @@
#include "lmdb-typed.hh"
namespace LMDBSafe {
unsigned int MDBGetMaxID(MDBRWTransaction& txn, MDBDbi& dbi)
{
auto cursor = txn->getRWCursor(dbi);
@ -11,4 +13,4 @@ unsigned int MDBGetMaxID(MDBRWTransaction& txn, MDBDbi& dbi)
return maxid;
}
}

View File

@ -7,10 +7,11 @@
#include <boost/iostreams/stream_buffer.hpp>
#include <boost/iostreams/device/back_inserter.hpp>
namespace LMDBSafe {
/*
Open issues:
Everything should go into a namespace
What is an error? What is an exception?
could id=0 be magic? ('no such id')
yes
@ -716,7 +717,4 @@ private:
std::string d_name;
};
}

View File

@ -9,6 +9,7 @@
#include <vector>
using namespace std;
using namespace LMDBSafe;
static void closeTest()
{
@ -240,3 +241,4 @@ int main(int argc, char** argv)
txn.commit();
}
*/

View File

@ -3,6 +3,7 @@
#include <iostream>
using namespace std;
using namespace LMDBSafe;
void countDB(MDBEnv& env, MDBROTransaction& txn, const std::string& dbname)
{

View File

@ -1,8 +1,10 @@
#include "lmdb-safe.hh"
using namespace std;
#include <unistd.h>
using namespace std;
using namespace LMDBSafe;
int main()
{
unlink("./multi");

View File

@ -6,6 +6,7 @@
#include <sstream>
using namespace std;
using namespace LMDBSafe;
struct Record
{

View File

@ -3,6 +3,7 @@
#include <cstring>
using namespace std;
using namespace LMDBSafe;
int main(int argc, char** argv)
{

View File

@ -1,5 +1,7 @@
#include "lmdb-safe.hh"
using namespace std;
using namespace LMDBSafe;
struct MDBVal
{

View File

@ -5,6 +5,7 @@
#include <iostream>
using namespace std;
using namespace LMDBSafe;
TEST_CASE("Most basic tests", "[mostbasic]") {
unlink("./tests");

View File

@ -5,6 +5,7 @@
#include <string>
using namespace std;
using namespace LMDBSafe;
struct DNSResourceRecord
{

View File

@ -6,6 +6,7 @@
#include <iostream>
using namespace std;
using namespace LMDBSafe;
struct Member
{