MXS-2208 Move trim-functions from maxscale to maxbase
log.h now includes string.hh, which is conceptually wrong, but log.h will shortly disappear and be superceded by log.hh.
This commit is contained in:
@ -1781,11 +1781,11 @@ json_t* Dbfw::diagnostics_json() const
|
||||
}
|
||||
|
||||
extern "C"
|
||||
void dbfilter_log_warning(const char* file, int line, const char* function,
|
||||
const char* format, const char* what)
|
||||
void log_warning(const char* module, const char* file, int line, const char* function,
|
||||
const char* format, const char* what)
|
||||
{
|
||||
char buffer[strlen(format) + strlen(what) + 1];
|
||||
|
||||
sprintf(buffer, format, what);
|
||||
mxb_log_message(LOG_WARNING, file, line, function, "%s", buffer);
|
||||
mxb_log_message(LOG_WARNING, module, file, line, function, "%s", buffer);
|
||||
}
|
||||
|
@ -905,7 +905,7 @@ void RegexHintFilter::set_source_addresses(const std::string& input_host_names,
|
||||
|
||||
for (auto host : mxs::strtok(host_names, ","))
|
||||
{
|
||||
char* trimmed_host = trim((char*)host.c_str());
|
||||
char* trimmed_host = mxb::trim((char*)host.c_str());
|
||||
|
||||
if (!add_source_address(trimmed_host, source_hosts))
|
||||
{
|
||||
|
@ -267,7 +267,7 @@ int avro_client_callback(DCB* dcb, DCB_REASON reason, void* userdata)
|
||||
*/
|
||||
std::pair<std::string, std::string> get_avrofile_and_gtid(std::string file)
|
||||
{
|
||||
mxs::ltrim(file);
|
||||
mxb::ltrim(file);
|
||||
auto pos = file.find_first_of(' ');
|
||||
std::string filename;
|
||||
std::string gtid;
|
||||
|
@ -2278,7 +2278,7 @@ static json_t* diagnostics_json(const MXS_ROUTER* router)
|
||||
|
||||
localtime_r(&session_last_event, &tm);
|
||||
asctime_r(&tm, buf);
|
||||
trim(buf);
|
||||
mxb::trim(buf);
|
||||
json_object_set_new(rval, "last_binlog_event_timestamp", json_string(buf));
|
||||
json_object_set_new(rval, "seconds_behind_master", json_integer(seconds_behind));
|
||||
}
|
||||
|
@ -4499,7 +4499,7 @@ static int blr_apply_change_master(ROUTER_INSTANCE* router,
|
||||
*/
|
||||
static char* get_connection_name(char* command, std::string* pConnection_name)
|
||||
{
|
||||
command = trim_leading(command);
|
||||
command = mxb::ltrim(command);
|
||||
|
||||
char* to = strcasestr(command, "TO");
|
||||
|
||||
|
@ -2113,7 +2113,7 @@ int execute_cmd(CLI_SESSION* cli)
|
||||
bool in_space = false;
|
||||
int nskip = 0;
|
||||
|
||||
args[0] = trim_leading(cli->cmdbuf);
|
||||
args[0] = mxb::ltrim(cli->cmdbuf);
|
||||
ptr = args[0];
|
||||
lptr = ptr;
|
||||
i = 1;
|
||||
|
Reference in New Issue
Block a user