mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-21 06:45:39 -06:00
Core: LoadFile checks whether path is a file (because POSIX opens a dir too), Core/Rpc: StopRpcServerTrace
git-svn-id: svn://ultimatepp.org/upp/trunk@5546 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
75e26144c8
commit
f5b00a9481
4 changed files with 641 additions and 632 deletions
|
|
@ -341,6 +341,7 @@ struct JsonRpcRequestNamed : RpcRequest {
|
|||
void LogRpcRequests(bool b = true);
|
||||
|
||||
void SetRpcServerTrace(Stream& s, int level = 1);
|
||||
void StopRpcServerTrace();
|
||||
|
||||
#include "legacy.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -55,6 +55,11 @@ void SetRpcServerTrace(Stream& s, int level)
|
|||
rpc_trace_level = level;
|
||||
}
|
||||
|
||||
void StopRpcServerTrace()
|
||||
{
|
||||
rpc_trace = NULL;
|
||||
}
|
||||
|
||||
bool CallRpcMethod(RpcData& data, const char *group, String methodname)
|
||||
{
|
||||
LLOG("method name: " << methodname);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
#ifndef _Core_Rpc_icpp_init_stub
|
||||
#define _Core_Rpc_icpp_init_stub
|
||||
#include "Web/init"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1496,9 +1496,13 @@ String LoadStream(Stream& in) {
|
|||
}
|
||||
|
||||
String LoadFile(const char *filename) {
|
||||
FindFile ff(filename);
|
||||
if(ff && ff.IsFile()) {
|
||||
FileIn in(filename);
|
||||
return LoadStream(in);
|
||||
}
|
||||
return String::GetVoid();
|
||||
}
|
||||
|
||||
bool SaveStream(Stream& out, const String& data) {
|
||||
if(!out.IsOpen() || out.IsError()) return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue