改善对GCC的兼容性

This commit is contained in:
nnhy 2016-10-21 09:28:41 +00:00
parent bbac078f95
commit 32adf306b1
5 changed files with 9 additions and 9 deletions

View File

@ -59,7 +59,7 @@ bool Proxy::SetConfig(Dictionary<cstring, int>& config, String& str)
return true;
}
bool Proxy::GetConfig(Dictionary<char *, int>& config)
bool Proxy::GetConfig(Dictionary<cstring, int>& config)
{
LoadConfig();
@ -219,7 +219,7 @@ bool ComProxy::OnSetConfig(Dictionary<cstring, int>& config, String& str)
return true;
}
bool ComProxy::OnGetConfig(Dictionary<char *, int>& config)
bool ComProxy::OnGetConfig(Dictionary<cstring, int>& config)
{
config.Add("baudrate", baudRate);

View File

@ -24,7 +24,7 @@ public:
bool Close();
bool SetConfig(Dictionary<cstring, int>& config, String& str);
bool GetConfig(Dictionary<char *, int>& config);
bool GetConfig(Dictionary<cstring, int>& config);
virtual int Write(Buffer& data) = 0;
virtual int Read(Buffer& data, Buffer& input) = 0;
void UploadTask();
@ -40,7 +40,7 @@ private:
virtual bool OnAutoTask() { return true; };
virtual bool OnSetConfig(Dictionary<cstring, int>& config, String& str) = 0;
virtual bool OnGetConfig(Dictionary<char *, int>& config) = 0;
virtual bool OnGetConfig(Dictionary<cstring, int>& config) = 0;
virtual bool OnGetConfig(Stream& cfg) { return true; };
virtual bool OnSetConfig(Stream& cfg) { return true; };
@ -59,7 +59,7 @@ public:
int baudRate;
virtual bool OnSetConfig(Dictionary<cstring, int>& config, String& str) override;
virtual bool OnGetConfig(Dictionary<char*, int>& config) override;
virtual bool OnGetConfig(Dictionary<cstring, int>& config) override;
virtual int Write(Buffer& data) override;
virtual int Read(Buffer& data, Buffer& input) override;

View File

@ -196,7 +196,7 @@ Json Json::Find(cstring key) const
// 读取成员。找到指定成员,并用它的值构造一个新的对象
const Json Json::operator[](cstring key) const { return Find(key); }
// 设置成员。找到指定成员,或添加成员,并返回对象
/*// 设置成员。找到指定成员,或添加成员,并返回对象
Json& Json::operator[](cstring key)
{
//if(!_s) return Find(key);
@ -207,7 +207,7 @@ Json& Json::operator[](cstring key)
json.SetOut(*_s);
return json;
}
}*/
// 特殊支持数组
int Json::Length() const

View File

@ -51,7 +51,7 @@ public:
// 读取成员。找到指定成员,并用它的值构造一个新的对象
const Json operator[](cstring key) const;
// 设置成员。找到指定成员,或添加成员,并返回对象
Json& operator[](cstring key);
//Json& operator[](cstring key);
// 特殊支持数组
int Length() const;

View File

@ -166,7 +166,7 @@ bool ProxyFactory::GetConfig(const Pair& args, Stream& result)
}
else
{
Dictionary<char*, int> cfg;
Dictionary<cstring, int> cfg;
port->GetConfig(cfg); // 调用端口的函数处理内容
if (cfg.Count() < 1)