mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
Stream::GetErrorText
git-svn-id: svn://ultimatepp.org/upp/trunk@10201 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
7901d120fd
commit
33238140d3
4 changed files with 13 additions and 2 deletions
|
|
@ -334,7 +334,7 @@ bool FileStream::Open(const char *name, dword mode) {
|
|||
NULL
|
||||
);
|
||||
if(handle == INVALID_HANDLE_VALUE) {
|
||||
SetError();
|
||||
SetLastError();
|
||||
return FALSE;
|
||||
}
|
||||
dword fsz_lo, fsz_hi;
|
||||
|
|
|
|||
|
|
@ -69,6 +69,11 @@ void Stream::LoadError() {
|
|||
throw LoadingError();
|
||||
}
|
||||
|
||||
String Stream::GetErrorText() const
|
||||
{
|
||||
return IsError() ? Upp::GetErrorMessage(errorcode) : String();
|
||||
}
|
||||
|
||||
bool Stream::GetAll(void *data, int size) {
|
||||
if(Get(data, size) != size) {
|
||||
LoadError();
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ public:
|
|||
void SetLastError() { SetError(errno); }
|
||||
#endif
|
||||
int GetError() const { return errorcode; }
|
||||
String GetErrorText() const;
|
||||
void ClearError() { style = style & ~STRM_ERROR; errorcode = 0; }
|
||||
|
||||
int64 GetPos() const { return dword(ptr - buffer) + pos; }
|
||||
|
|
|
|||
|
|
@ -334,7 +334,12 @@ can be interpreted by GetErrorMessage function.&]
|
|||
[s4;%- &]
|
||||
[s5;:Stream`:`:GetError`(`)const:%- [@(0.0.255) int]_[* GetError]()_[@(0.0.255) const]&]
|
||||
[s2; Returns current error`-code. Zero indicates no error.&]
|
||||
[s3; &]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Upp`:`:Stream`:`:GetErrorText`(`)const:%- [_^Upp`:`:String^ String]_[* GetErrorText](
|
||||
)_[@(0.0.255) const]&]
|
||||
[s2; Returns the text description of the last error.&]
|
||||
[s3;%- &]
|
||||
[s4;%- &]
|
||||
[s5;:Stream`:`:ClearError`(`):%- [@(0.0.255) void]_[* ClearError]()&]
|
||||
[s2; Clears error code.&]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue