Merge remote-tracking branch 'origin/topic/timw/776-using-statements'

* origin/topic/timw/776-using-statements:
  Remove 'using namespace std' from SerialTypes.h
  Remove other using statements from headers
  GH-776: Remove using statements added by PR 770

Includes small fixes in files that changed since the merge request was
made.

Also includes a few small indentation fixes.
This commit is contained in:
Johanna Amann 2020-04-09 13:11:12 -07:00
commit 876c803d75
147 changed files with 553 additions and 579 deletions

View file

@ -26,6 +26,7 @@
#include <broker/endpoint_info.hh>
using namespace std;
using namespace logging;
struct Manager::Filter {

View file

@ -112,7 +112,7 @@ public:
* This methods corresponds directly to the internal BiF defined in
* logging.bif, which just forwards here.
*/
bool RemoveFilter(EnumVal* id, const string& name);
bool RemoveFilter(EnumVal* id, const std::string& name);
/**
* Write a record to a log stream.
@ -165,7 +165,7 @@ public:
* @param vals An array of log values to write, of size num_fields.
* The method takes ownership of the array.
*/
bool WriteFromRemote(EnumVal* stream, EnumVal* writer, const string& path,
bool WriteFromRemote(EnumVal* stream, EnumVal* writer, const std::string& path,
int num_fields, threading::Value** vals);
/**
@ -241,7 +241,7 @@ protected:
// Takes ownership of fields and info.
WriterFrontend* CreateWriter(EnumVal* id, EnumVal* writer, WriterBackend::WriterInfo* info,
int num_fields, const threading::Field* const* fields,
bool local, bool remote, bool from_remote, const string& instantiating_filter="");
bool local, bool remote, bool from_remote, const std::string& instantiating_filter="");
// Signals that a file has been rotated.
bool FinishedRotation(WriterFrontend* writer, const char* new_name, const char* old_name,
@ -256,7 +256,7 @@ private:
struct WriterInfo;
bool TraverseRecord(Stream* stream, Filter* filter, RecordType* rt,
TableVal* include, TableVal* exclude, const string& path, const list<int>& indices);
TableVal* include, TableVal* exclude, const std::string& path, const std::list<int>& indices);
threading::Value** RecordToFilterVals(Stream* stream, Filter* filter,
RecordVal* columns);
@ -270,7 +270,7 @@ private:
bool CompareFields(const Filter* filter, const WriterFrontend* writer);
bool CheckFilterWriterConflict(const WriterInfo* winfo, const Filter* filter);
vector<Stream *> streams; // Indexed by stream enum.
std::vector<Stream *> streams; // Indexed by stream enum.
int rotations_pending; // Number of rotations not yet finished.
};

View file

@ -10,6 +10,7 @@
#include "Ascii.h"
#include "ascii.bif.h"
using namespace std;
using namespace logging::writer;
using namespace threading;
using threading::Value;

View file

@ -17,7 +17,7 @@ public:
explicit Ascii(WriterFrontend* frontend);
~Ascii() override;
static string LogExt();
static std::string LogExt();
static WriterBackend* Instantiate(WriterFrontend* frontend)
{ return new Ascii(frontend); }
@ -35,11 +35,11 @@ protected:
bool DoHeartbeat(double network_time, double current_time) override;
private:
bool IsSpecial(const string &path) { return path.find("/dev/") == 0; }
bool WriteHeader(const string& path);
bool WriteHeaderField(const string& key, const string& value);
bool IsSpecial(const std::string &path) { return path.find("/dev/") == 0; }
bool WriteHeader(const std::string& path);
bool WriteHeaderField(const std::string& key, const std::string& value);
void CloseFile(double t);
string Timestamp(double t); // Uses current time if t is zero.
std::string Timestamp(double t); // Uses current time if t is zero.
void InitConfigOptions();
bool InitFilterOptions();
bool InitFormatter();
@ -48,7 +48,7 @@ private:
int fd;
gzFile gzfile;
string fname;
std::string fname;
ODesc desc;
bool ascii_done;
@ -57,17 +57,17 @@ private:
bool include_meta;
bool tsv;
string separator;
string set_separator;
string empty_field;
string unset_field;
string meta_prefix;
std::string separator;
std::string set_separator;
std::string empty_field;
std::string unset_field;
std::string meta_prefix;
int gzip_level; // level > 0 enables gzip compression
string gzip_file_extension;
std::string gzip_file_extension;
bool use_json;
bool enable_utf_8;
string json_timestamps;
std::string json_timestamps;
threading::formatter::Formatter* formatter;
bool init_options;

View file

@ -21,14 +21,14 @@ bool None::DoInit(const WriterInfo& info, int num_fields,
// Output the config sorted by keys.
std::vector<std::pair<string, string> > keys;
std::vector<std::pair<std::string, std::string> > keys;
for ( WriterInfo::config_map::const_iterator i = info.config.begin(); i != info.config.end(); i++ )
keys.push_back(std::make_pair(i->first, i->second));
std::sort(keys.begin(), keys.end());
for ( std::vector<std::pair<string,string> >::const_iterator i = keys.begin(); i != keys.end(); i++ )
for ( std::vector<std::pair<std::string, std::string> >::const_iterator i = keys.begin(); i != keys.end(); i++ )
std::cout << " config[" << (*i).first << "] = " << (*i).second << std::endl;
for ( int i = 0; i < num_fields; i++ )

View file

@ -11,6 +11,7 @@
#include "SQLite.h"
#include "sqlite.bif.h"
using namespace std;
using namespace logging;
using namespace writer;
using threading::Value;

View file

@ -37,7 +37,7 @@ private:
bool checkError(int code);
int AddParams(threading::Value* val, int pos);
string GetTableType(int, int);
std::string GetTableType(int, int);
const threading::Field* const * fields; // raw mapping
unsigned int num_fields;
@ -45,9 +45,9 @@ private:
sqlite3 *db;
sqlite3_stmt *st;
string set_separator;
string unset_field;
string empty_field;
std::string set_separator;
std::string unset_field;
std::string empty_field;
threading::formatter::Ascii* io;
};