Exemplo n.º 1
0
// public static void DeleteFile(string filename) [static] :1150
void FileSystemImpl::DeleteFile(uString* filename_)
{
    try
    {
        Xli::Disk->DeleteFile(uStringToXliString(filename_));
    }
    catch (const Xli::Exception& e)
    {
        throw uThrowable(::g::Uno::IO::IOException::New4(uStringFromXliString(e.GetMessage())), e.GetFunction(), e.GetLine());
    }
}
Exemplo n.º 2
0
// public static string GetUserDirectory(Uno.IO.UserDirectory dir) [static] :1114
uString* FileSystemImpl::GetUserDirectory(int dir_)
{
    try
    {
        return uStringFromXliString(Xli::Disk->GetSystemDirectory((Xli::SystemDirectory)dir_));
    }
    catch (const Xli::Exception& e)
    {
        throw uThrowable(::g::Uno::IO::IOException::New4(uStringFromXliString(e.GetMessage())), e.GetFunction(), e.GetLine());
    }
}
Exemplo n.º 3
0
// public generated override sealed extern long get_Position() :634
void CppXliStream__get_Position_fn(CppXliStream* __this, int64_t* __retval)
{
    try
    {
        return *__retval = __this->_handle->GetPosition(), void();
    }
    catch (const Xli::Exception& e)
    {
        throw uThrowable(::g::Uno::IO::IOException::New4(uStringFromXliString(e.GetMessage())), e.GetFunction(), e.GetLine());
    }
}
Exemplo n.º 4
0
// public static extern Uno.IO.CppXliStreamHandle CppXliOpenRead(string filename) [static] :1105
::Xli::Stream* FileSystemImpl::CppXliOpenRead(uString* filename_)
{
    try
    {
        return Xli::Disk->OpenFile(uStringToXliString(filename_), Xli::FileModeRead);
    }
    catch (const Xli::Exception& e)
    {
        throw uThrowable(::g::Uno::IO::IOException::New4(uStringFromXliString(e.GetMessage())), e.GetFunction(), e.GetLine());
    }
}
Exemplo n.º 5
0
// public override sealed extern void Flush() :651
void CppXliStream__Flush_fn(CppXliStream* __this)
{
    try
    {
        __this->_handle->Flush();
    }
    catch (const Xli::Exception& e)
    {
        throw uThrowable(::g::Uno::IO::IOException::New4(uStringFromXliString(e.GetMessage())), e.GetFunction(), e.GetLine());
    }
}
Exemplo n.º 6
0
// public static void WriteAllBytes(string filename, byte[] bytes) [static] :1216
void FileSystemImpl::WriteAllBytes(uString* filename_, uArray* bytes_)
{
    try
    {
        Xli::Managed<Xli::Stream> f = Xli::Disk->OpenFile(uStringToXliString(filename_), Xli::FileModeWrite);
        f->Write(bytes_->Ptr(), 1, bytes_->Length());
    }
    catch (const Xli::Exception& e)
    {
        throw uThrowable(::g::Uno::IO::IOException::New4(uStringFromXliString(e.GetMessage())), e.GetFunction(), e.GetLine());
    }
}
Exemplo n.º 7
0
// public generated override sealed extern void set_Position(long value) :634
void CppXliStream__set_Position_fn(CppXliStream* __this, int64_t* value_)
{
    int64_t value__ = *value_;
    try
    {
        __this->_handle->Seek((int)value__, Xli::SeekOriginBegin);
    }
    catch (const Xli::Exception& e)
    {
        throw uThrowable(::g::Uno::IO::IOException::New4(uStringFromXliString(e.GetMessage())), e.GetFunction(), e.GetLine());
    }
}
Exemplo n.º 8
0
// public override sealed extern void Write(byte[] src, int byteOffset, int byteCount) :645
void CppXliStream__Write_fn(CppXliStream* __this, uArray* src_, int* byteOffset_, int* byteCount_)
{
    int byteOffset__ = *byteOffset_;
    int byteCount__ = *byteCount_;
    try
    {
        // TODO: Bounds check
        __this->_handle->Write((const uint8_t*)src_->Ptr() + byteOffset__, 1, byteCount__);
    }
    catch (const Xli::Exception& e)
    {
        throw uThrowable(::g::Uno::IO::IOException::New4(uStringFromXliString(e.GetMessage())), e.GetFunction(), e.GetLine());
    }
}
Exemplo n.º 9
0
// public override sealed extern int Read(byte[] dst, int byteOffset, int byteCount) :642
void CppXliStream__Read_fn(CppXliStream* __this, uArray* dst_, int* byteOffset_, int* byteCount_, int* __retval)
{
    int byteOffset__ = *byteOffset_;
    int byteCount__ = *byteCount_;
    try
    {
        // TODO: Bounds check
        return *__retval = __this->_handle->Read((uint8_t*)dst_->Ptr() + byteOffset__, 1, byteCount__), void();
    }
    catch (const Xli::Exception& e)
    {
        throw uThrowable(::g::Uno::IO::IOException::New4(uStringFromXliString(e.GetMessage())), e.GetFunction(), e.GetLine());
    }
}
Exemplo n.º 10
0
void uThrowable::ThrowIndexOutOfRange(const char* file, int line)
{
    throw uThrowable(::g::Uno::IndexOutOfRangeException::New4(), file, line);
}
Exemplo n.º 11
0
void uThrowable::ThrowInvalidOperation(const char* file, int line)
{
    throw uThrowable(::g::Uno::InvalidOperationException::New4(), file, line);
}
Exemplo n.º 12
0
void uThrowable::ThrowNullReference(const char* file, int line)
{
    throw uThrowable(::g::Uno::NullReferenceException::New4(), file, line);
}