mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-06-13 22:04:36 -06:00
Core/SSH: Some more methods
git-svn-id: svn://ultimatepp.org/upp/trunk@12155 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
5571f5f2ed
commit
b982e430e0
2 changed files with 18 additions and 4 deletions
|
|
@ -279,6 +279,18 @@ String SFtp::LoadFile(const char *path)
|
|||
return LoadStream(in);
|
||||
}
|
||||
|
||||
bool SFtp::SaveFile(const char *path, Stream& in)
|
||||
{
|
||||
SFtpFileOut out(*this, path);
|
||||
return CopyStream(out, in) >= 0;
|
||||
}
|
||||
|
||||
void SFtp::LoadFile(Stream& out, const char *path)
|
||||
{
|
||||
SFtpFileIn in(*this, path);
|
||||
return CopyStream(in, out) >= 0;
|
||||
}
|
||||
|
||||
bool SFtp::Get(SFtpHandle handle, Stream& out)
|
||||
{
|
||||
sftp->done = 0;
|
||||
|
|
|
|||
|
|
@ -95,10 +95,12 @@ public:
|
|||
SFtp& Seek(SFtpHandle handle, int64 position);
|
||||
int64 GetPos(SFtpHandle handle);
|
||||
|
||||
int Get(SFtpHandle handle, void *ptr, int size = INT_MAX);
|
||||
bool Put(SFtpHandle handle, const void *ptr, int size);
|
||||
bool SaveFile(const char *path, const String& data);
|
||||
String LoadFile(const char *path);
|
||||
int Get(SFtpHandle handle, void *ptr, int size = INT_MAX);
|
||||
bool Put(SFtpHandle handle, const void *ptr, int size);
|
||||
bool SaveFile(const char *path, const String& data);
|
||||
String LoadFile(const char *path);
|
||||
bool SaveFile(const char *path, Stream& in);
|
||||
void LoadFile(Stream& out, const char *path);
|
||||
|
||||
// Read/Write
|
||||
bool Get(SFtpHandle handle, Stream& out);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue