os <<
str.size() <<
' '<<
str;
55string::size_type
len;
56 if(!is.good())
returnis;
58 if(!is.good())
returnis;
59vector<char>
buf(
len+1);
60is.read(&
buf[0],
len+1);
77 size_tmax_inline_size
)
90 "Cannot open "+ fname +
" for output");
102 if(istream.good()) istream >> res;
121 "Job output does not match remote_app output format";
128 if(fname) *fname = name;
135 string msg=
"Can not open "+ name;
136 msg+=
" for reading";
170 const string& fname = it->first;
177 if(!
file.Exists()) {
182 LOG_POST_X(4,
Warning<<
"File :\""<< fname <<
"\" is not found in cmdline. Skipping.");
188unique_ptr<CNcbiOstream> of(
GetNetCacheAPI().CreateOStream(blobid));
190file_map[fname] = blobid;
197os << file_map.size() <<
' ';
198 ITERATE(TFmap, itf, file_map) {
210 static void s_ReplaceArg( vector<string>& args,
const string& old_fname,
211 const string& new_fname)
213 for(vector<string>::iterator it = args.begin();
214it != args.end(); ++it) {
219 if( (pos == 0 || !
isalnum((
unsigned char)arg[pos-1]) )
220&& pos + old_fname.size() == arg.size())
229 const boolpartial_deserialization = files;
231 if(partial_deserialization)
243 if(!is.good())
return false;
245 if( fcount > 0 && !partial_deserialization) {
250 for(
int i= 0;
i< fcount; ++
i) {
251 stringblobid, fname;
254 if(!is.good())
return false;
257 if(partial_deserialization) {
259}
else if(is_blob) {
265of << blob_is->rdbuf();
271 if( fcount > 0 && !partial_deserialization) {
277 if(!is.good())
return false;
281 if(!is.good())
return false;
283 if(!is.good())
return false;
329m_NetCacheAPI(storage),
331m_TmpDirPath(
CDir::GetCwd() +
CDirEntry::GetPathSeparator()),
332m_StdIn(storage, m_InBlobIdOrData, m_StdInDataSize),
335m_ExlusiveMode(
false),
336m_MaxInlineSize(max_inline_size)
383 if(!cmdline.empty()) {
386 for(
size_t i= 0;
i< cmdline.size();) {
387 if(cmdline[
i] ==
' ') {
395 if(cmdline[
i] ==
'\''|| cmdline[
i] ==
'"') {
396 charquote = cmdline[
i];
397 while( ++
i< cmdline.size() && cmdline[
i] != quote )
404arg += cmdline[
i++];
416 for(vector<string>::const_iterator it = args.begin();
417it != args.end(); ++it) {
418 if(it != args.begin())
421 if(it->find(
" ") != string::npos)
422cmd_line +=
'\"'+ *it +
'\"';
CNcbiOstream & GetOStream(const string &fname="", EStdOutErrStorageType type=eBlobStorage, size_t max_inline_size=kMaxBlobInlineSize)
static int x_GetTypeAndName(CNcbiIstream &istream, string &name)
CNcbiIstream & GetIStream(string *fname=NULL, EStdOutErrStorageType *type=NULL)
EStdOutErrStorageType m_StorageType
const TFiles & GetFileNames() const
CNetCacheAPI & GetNetCacheAPI()
const string & GetWorkingDir() const
void Send(CNcbiOstream &os)
Serialize a request to a given stream.
CBlobStreamHelper m_StdIn
static CAtomicCounter sm_DirCounter
void SetAppRunTimeout(unsigned int sec)
const string & GetCmdLine() const
Get the command line of the remote application.
bool x_Deserialize(CNcbiIstream &is, TStoredFiles *files=NULL)
unsigned int GetAppRunTimeout() const
unsigned int m_AppRunTimeout
void SetCmdLine(const string &cmdline)
Set the command line for the remote application.
CRemoteAppRequest(CNetCacheAPI::TInstance storage, size_t max_inline_size=kMaxBlobInlineSize)
CBlobStreamHelper m_StdErr
void SetRetCode(int ret_code)
void Serialize(CNcbiOstream &os)
void Receive(CNcbiIstream &is)
Deserialize a request from a given stream.
EStdOutErrStorageType m_StorageType
CBlobStreamHelper m_StdOut
iterator_bool insert(const value_type &val)
static const char * str(char *buf, int n)
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
TValue Add(int delta) THROWS_NONE
Atomically add value (=delta), and return new counter value.
#define LOG_POST_X(err_subcode, message)
#define ERR_POST_X(err_subcode, message)
Error posting with default error code and given error subcode.
#define NCBI_CATCH_ALL_X(err_subcode, message)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Warning(CExceptionArgs_Base &args)
bool CreatePath(TCreateFlags flags=fCreate_Default) const
Create the directory path recursively possibly more than one at a time.
virtual bool Exists(void) const
Check if directory "dirname" exists.
static char GetPathSeparator(void)
Get path separator symbol specific for the current platform.
virtual bool Remove(TRemoveFlags flags=eRecursive) const
Delete existing directory.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ofstream CNcbiOfstream
Portable alias for ofstream.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
NCBI_NS_STD::string::size_type SIZE_TYPE
static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the string.
static string & Replace(const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
unsigned int
A callback function used to compare two keys in a database.
Definition of all error codes used in connect services library (xconnserv.lib and others).
Defines classes: CDirEntry, CFile, CDir, CSymLink, CMemoryFile, CFileUtil, CFileLock,...
CNcbiIstream & ReadStrWithLen(CNcbiIstream &is, string &str)
const string kLocalFSSign
static void s_ReplaceArg(vector< string > &args, const string &old_fname, const string &new_fname)
string JoinCmdLine(const vector< string > &args)
CNcbiOstream & WriteStrWithLen(CNcbiOstream &os, const string &str)
void TokenizeCmdLine(const string &cmdline, vector< string > &args)
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
unique_ptr< CNcbiIstream > stream
unique_ptr< IEmbeddedStreamWriter > writer
unique_ptr< CNcbiOstream > stream
void Reset(bool flush=false)
unique_ptr< CObjectIStream > GetIStream(string path, ESerialDataFormat serial_format)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4