Skip to content

Commit

Permalink
update base conf
Browse files Browse the repository at this point in the history
  • Loading branch information
baotiao committed Sep 11, 2017
1 parent f17f327 commit f42b658
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
20 changes: 10 additions & 10 deletions slash/include/base_conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.

#ifndef INCLUDE_BASE_CONF_H_
#define INCLUDE_BASE_CONF_H_
#include "stdlib.h"
#include "stdio.h"
#ifndef SLASH_INCLUDE_BASE_CONF_H_
#define SLASH_INCLUDE_BASE_CONF_H_

#include <stdlib.h>
#include <stdio.h>

#include <string>
#include <vector>
Expand All @@ -15,15 +16,15 @@

namespace slash {

class BaseConf
{
public:
class BaseConf {
public:
explicit BaseConf(const std::string &path);
virtual ~BaseConf();

int LoadConf();
int32_t ReloadConf();

// return false if the item dosen't exist
bool GetConfInt(const std::string &name, int* value) const;
bool GetConfInt64(const std::string &name, int64_t* value) const;

Expand All @@ -42,8 +43,7 @@ class BaseConf
bool WriteBack();
void WriteSampleConf() const;

private:

private:
struct Rep;
Rep* rep_;

Expand All @@ -56,4 +56,4 @@ class BaseConf

} // namespace slash

#endif // INCLUDE_BASE_CONF_H_
#endif // SLASH_INCLUDE_BASE_CONF_H_
4 changes: 2 additions & 2 deletions slash/src/base_conf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ struct BaseConf::Rep {
{}
};

Rep(const std::string &p)
explicit Rep(const std::string &p)
: path(p) {
}
std::vector<ConfItem> item;
Expand Down Expand Up @@ -262,7 +262,7 @@ bool BaseConf::SetConfBool(const std::string &name, const bool value) {

bool BaseConf::SetConfStrVec(const std::string& name, const std::vector<std::string> &value) {
std::string value_str = StringConcat(value, COMMA);
return SetConfStr(name, value_str);
return SetConfStr(name, value_str);
}

void BaseConf::DumpConf() const {
Expand Down

0 comments on commit f42b658

Please sign in to comment.