Commit b0297a13 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2536] Remove "using namespace" from headers (DHCP code)

parent 9fcbaef6
......@@ -34,9 +34,6 @@
#include <fstream>
using namespace isc::hooks;
using namespace std;
extern "C" {
/// @brief Append digit to marker file
......@@ -51,7 +48,7 @@ extern "C" {
int
appendDigit(const char* name) {
// Open the file and check if successful.
fstream file(name, fstream::out | fstream::app);
std::fstream file(name, std::fstream::out | std::fstream::app);
if (!file.good()) {
return (1);
}
......@@ -70,7 +67,7 @@ version() {
}
int
load(LibraryHandle&) {
load(isc::hooks::LibraryHandle&) {
return (appendDigit(LOAD_MARKER_FILE));
}
......
......@@ -34,9 +34,6 @@
#include <fstream>
using namespace isc::hooks;
using namespace std;
extern "C" {
/// @brief Append digit to marker file
......@@ -51,7 +48,7 @@ extern "C" {
int
appendDigit(const char* name) {
// Open the file and check if successful.
fstream file(name, fstream::out | fstream::app);
std::fstream file(name, std::fstream::out | std::fstream::app);
if (!file.good()) {
return (1);
}
......@@ -70,7 +67,7 @@ version() {
}
int
load(LibraryHandle&) {
load(isc::hooks::LibraryHandle&) {
return (appendDigit(LOAD_MARKER_FILE));
}
......
......@@ -47,6 +47,8 @@
#include <sstream>
using namespace isc;
using namespace isc::data;
using namespace isc::config;
using namespace isc::test;
using namespace isc::asiolink;
using namespace isc::dhcp;
......
......@@ -15,6 +15,9 @@
#include <gtest/gtest.h>
#include <dhcp6/tests/dhcp6_test_utils.h>
using namespace isc::dhcp;
using namespace isc::asiolink;
namespace isc {
namespace test {
......
This diff is collapsed.
......@@ -36,6 +36,8 @@
#include <sstream>
using namespace isc;
using namespace isc::data;
using namespace isc::config;
using namespace isc::test;
using namespace isc::asiolink;
using namespace isc::dhcp;
......
......@@ -38,6 +38,8 @@
/// (Make sure that the packet is expanded in the view. The text file will
/// contain whatever expansion level you have in the graphical tree.)
using namespace isc::dhcp;
using namespace isc::asiolink;
using namespace std;
namespace isc {
......
......@@ -18,14 +18,11 @@
#include <fstream>
#include <string>
using namespace std;
using namespace user_chk;
// The following constants are used throughout the library. They are defined
// in load_unload.cc
/// @brief Pointer to the registry instance.
extern UserRegistryPtr user_registry;
extern user_chk::UserRegistryPtr user_registry;
/// @brief Output filestream for recording user check outcomes.
extern std::fstream user_chk_output;
......
......@@ -35,7 +35,7 @@ UserFile::~UserFile(){
void
UserFile::open() {
if (isOpen()) {
isc_throw (UserFileError, "file is already open");
isc_throw(UserFileError, "file is already open");
}
file_.open(fname_.c_str(), std::ifstream::in);
......
......@@ -23,17 +23,15 @@
#include <fstream>
#include <string>
using namespace std;
namespace user_chk {
/// @brief Thrown a UserFile encounters an error.
/// Note that it derives from UserDataSourceError to comply with the interface.
class UserFileError : public UserDataSourceError {
public:
UserFileError(const char* file, size_t line,
const char* what) :
UserDataSourceError(file, line, what) { };
UserFileError(const char* file, size_t line, const char* what) :
UserDataSourceError(file, line, what)
{}
};
/// @brief Provides a UserDataSource implementation for JSON text files.
......@@ -125,7 +123,7 @@ public:
private:
/// @brief Pathname of the input text file.
string fname_;
std::string fname_;
/// @brief Input file stream.
std::ifstream file_;
......
......@@ -24,16 +24,14 @@
#include <string>
using namespace std;
namespace user_chk {
/// @brief Thrown UserRegistry encounters an error
class UserRegistryError : public isc::Exception {
public:
UserRegistryError(const char* file, size_t line,
const char* what) :
isc::Exception(file, line, what) { };
UserRegistryError(const char* file, size_t line, const char* what) :
isc::Exception(file, line, what)
{}
};
/// @brief Defines a map of unique Users keyed by UserId.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment