Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
c2ac8569
Kaydet (Commit)
c2ac8569
authored
Tem 28, 2015
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
convert SBSTRM constants to scoped enum
Change-Id: I478a9c7eca6509baf3e9a3dd3ce3dd8f3060f842
üst
6484b2fd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
36 additions
and
27 deletions
+36
-27
io.cxx
basic/source/comp/io.cxx
+7
-7
iosys.hxx
basic/source/inc/iosys.hxx
+23
-14
iosys.cxx
basic/source/runtime/iosys.cxx
+3
-3
methods1.cxx
basic/source/runtime/methods1.cxx
+2
-2
runtime.cxx
basic/source/runtime/runtime.cxx
+1
-1
No files found.
basic/source/comp/io.cxx
Dosyayı görüntüle @
c2ac8569
...
...
@@ -174,19 +174,19 @@ void SbiParser::Open()
SbiToken
eTok
;
TestToken
(
FOR
);
StreamMode
nMode
=
StreamMode
::
NONE
;
short
nFlags
=
0
;
SbiStreamFlags
nFlags
=
SbiStreamFlags
::
NONE
;
switch
(
Next
()
)
{
case
INPUT
:
nMode
=
StreamMode
::
READ
;
nFlags
|=
S
BSTRM_INPUT
;
break
;
nMode
=
StreamMode
::
READ
;
nFlags
|=
S
biStreamFlags
::
Input
;
break
;
case
OUTPUT
:
nMode
=
StreamMode
::
WRITE
|
StreamMode
::
TRUNC
;
nFlags
|=
S
BSTRM_OUTPUT
;
break
;
nMode
=
StreamMode
::
WRITE
|
StreamMode
::
TRUNC
;
nFlags
|=
S
biStreamFlags
::
Output
;
break
;
case
APPEND
:
nMode
=
StreamMode
::
WRITE
;
nFlags
|=
S
BSTRM_APPEND
;
break
;
nMode
=
StreamMode
::
WRITE
;
nFlags
|=
S
biStreamFlags
::
Append
;
break
;
case
RANDOM
:
nMode
=
StreamMode
::
READ
|
StreamMode
::
WRITE
;
nFlags
|=
S
BSTRM_RANDOM
;
break
;
nMode
=
StreamMode
::
READ
|
StreamMode
::
WRITE
;
nFlags
|=
S
biStreamFlags
::
Random
;
break
;
case
BINARY
:
nMode
=
StreamMode
::
READ
|
StreamMode
::
WRITE
;
nFlags
|=
S
BSTRM_BINARY
;
break
;
nMode
=
StreamMode
::
READ
|
StreamMode
::
WRITE
;
nFlags
|=
S
biStreamFlags
::
Binary
;
break
;
default
:
Error
(
ERRCODE_BASIC_SYNTAX
);
}
...
...
@@ -262,7 +262,7 @@ void SbiParser::Open()
if
(
pChan
)
pChan
->
Gen
();
aFileName
.
Gen
();
aGen
.
Gen
(
_OPEN
,
static_cast
<
sal_uInt32
>
(
nMode
),
nFlags
);
aGen
.
Gen
(
_OPEN
,
static_cast
<
sal_uInt32
>
(
nMode
),
static_cast
<
sal_uInt32
>
(
nFlags
)
);
bInStatement
=
false
;
}
...
...
basic/source/inc/iosys.hxx
Dosyayı görüntüle @
c2ac8569
...
...
@@ -22,6 +22,7 @@
#include <tools/stream.hxx>
#include <basic/sberrors.hxx>
#include <o3tl/typed_flags_set.hxx>
class
SvStream
;
...
...
@@ -30,11 +31,19 @@ class SvStream;
#define CHANNELS 256
#define SBSTRM_INPUT 0x0001
#define SBSTRM_OUTPUT 0x0002
#define SBSTRM_RANDOM 0x0004
#define SBSTRM_APPEND 0x0008
#define SBSTRM_BINARY 0x0010
enum
class
SbiStreamFlags
{
NONE
=
0x0000
,
Input
=
0x0001
,
Output
=
0x0002
,
Random
=
0x0004
,
Append
=
0x0008
,
Binary
=
0x0010
,
};
namespace
o3tl
{
template
<>
struct
typed_flags
<
SbiStreamFlags
>
:
is_typed_flags
<
SbiStreamFlags
,
0x1f
>
{};
}
class
SbiStream
{
...
...
@@ -43,7 +52,7 @@ class SbiStream
OString
aLine
;
sal_uIntPtr
nLine
;
short
nLen
;
// buffer length
short
nMode
;
SbiStreamFlags
nMode
;
short
nChan
;
SbError
nError
;
void
MapError
();
...
...
@@ -51,19 +60,19 @@ class SbiStream
public
:
SbiStream
();
~
SbiStream
();
SbError
Open
(
short
,
const
OString
&
,
StreamMode
,
short
,
short
);
SbError
Open
(
short
,
const
OString
&
,
StreamMode
,
SbiStreamFlags
,
short
);
SbError
Close
();
SbError
Read
(
OString
&
,
sal_uInt16
=
0
,
bool
bForceReadingPerByte
=
false
);
SbError
Read
(
char
&
);
SbError
Write
(
const
OString
&
,
sal_uInt16
=
0
);
bool
IsText
()
const
{
return
(
nMode
&
SBSTRM_BINARY
)
==
0
;
}
bool
IsRandom
()
const
{
return
(
nMode
&
SBSTRM_RANDOM
)
!=
0
;
}
bool
IsBinary
()
const
{
return
(
nMode
&
SBSTRM_BINARY
)
!=
0
;
}
bool
IsSeq
()
const
{
return
(
nMode
&
SBSTRM_RANDOM
)
==
0
;
}
bool
IsAppend
()
const
{
return
(
nMode
&
SBSTRM_APPEND
)
!=
0
;
}
bool
IsText
()
const
{
return
!
bool
(
nMode
&
SbiStreamFlags
::
Binary
)
;
}
bool
IsRandom
()
const
{
return
bool
(
nMode
&
SbiStreamFlags
::
Random
)
;
}
bool
IsBinary
()
const
{
return
bool
(
nMode
&
SbiStreamFlags
::
Binary
)
;
}
bool
IsSeq
()
const
{
return
!
bool
(
nMode
&
SbiStreamFlags
::
Random
)
;
}
bool
IsAppend
()
const
{
return
bool
(
nMode
&
SbiStreamFlags
::
Append
)
;
}
short
GetBlockLen
()
const
{
return
nLen
;
}
short
GetMode
()
const
{
return
nMode
;
}
SbiStreamFlags
GetMode
()
const
{
return
nMode
;
}
sal_uIntPtr
GetLine
()
const
{
return
nLine
;
}
void
SetExpandOnWriteTo
(
sal_uIntPtr
n
)
{
nExpandOnWriteTo
=
n
;
}
void
ExpandFile
();
...
...
@@ -89,7 +98,7 @@ public:
void
SetChannel
(
short
n
)
{
nChan
=
n
;
}
short
GetChannel
()
const
{
return
nChan
;}
void
ResetChannel
()
{
nChan
=
0
;
}
void
Open
(
short
,
const
OString
&
,
StreamMode
,
short
,
short
);
void
Open
(
short
,
const
OString
&
,
StreamMode
,
SbiStreamFlags
,
short
);
void
Close
();
void
Read
(
OString
&
,
short
=
0
);
char
Read
();
...
...
basic/source/runtime/iosys.cxx
Dosyayı görüntüle @
c2ac8569
...
...
@@ -137,7 +137,7 @@ SbiStream::SbiStream()
,
nExpandOnWriteTo
(
0
)
,
nLine
(
0
)
,
nLen
(
0
)
,
nMode
(
0
)
,
nMode
(
SbiStreamFlags
::
NONE
)
,
nChan
(
0
)
,
nError
(
0
)
{
...
...
@@ -569,7 +569,7 @@ void UCBStream::SetSize( sal_uInt64 nSize )
SbError
SbiStream
::
Open
(
short
nCh
,
const
OString
&
rName
,
StreamMode
nStrmMode
,
short
nFlags
,
short
nL
)
(
short
nCh
,
const
OString
&
rName
,
StreamMode
nStrmMode
,
SbiStreamFlags
nFlags
,
short
nL
)
{
nMode
=
nFlags
;
nLen
=
nL
;
...
...
@@ -794,7 +794,7 @@ SbError SbiIoSystem::GetError()
return
n
;
}
void
SbiIoSystem
::
Open
(
short
nCh
,
const
OString
&
rName
,
StreamMode
nMode
,
short
nFlags
,
short
nLen
)
void
SbiIoSystem
::
Open
(
short
nCh
,
const
OString
&
rName
,
StreamMode
nMode
,
SbiStreamFlags
nFlags
,
short
nLen
)
{
nError
=
0
;
if
(
nCh
>=
CHANNELS
||
!
nCh
)
...
...
basic/source/runtime/methods1.cxx
Dosyayı görüntüle @
c2ac8569
...
...
@@ -1248,7 +1248,7 @@ void PutGet( SbxArray& rPar, bool bPut )
SbiIoSystem
*
pIO
=
GetSbData
()
->
pInst
->
GetIoSystem
();
SbiStream
*
pSbStrm
=
pIO
->
GetStream
(
nFileNo
);
if
(
!
pSbStrm
||
!
(
pSbStrm
->
GetMode
()
&
(
S
BSTRM_BINARY
|
SBSTRM_RANDOM
))
)
if
(
!
pSbStrm
||
!
(
pSbStrm
->
GetMode
()
&
(
S
biStreamFlags
::
Binary
|
SbiStreamFlags
::
Random
))
)
{
StarBASIC
::
Error
(
ERRCODE_BASIC_BAD_CHANNEL
);
return
;
...
...
@@ -3263,7 +3263,7 @@ RTLFUNC(Input)
SbiIoSystem
*
pIosys
=
GetSbData
()
->
pInst
->
GetIoSystem
();
SbiStream
*
pSbStrm
=
pIosys
->
GetStream
(
nFileNumber
);
if
(
!
pSbStrm
||
!
(
pSbStrm
->
GetMode
()
&
(
S
BSTRM_BINARY
|
SBSTRM_INPUT
))
)
if
(
!
pSbStrm
||
!
(
pSbStrm
->
GetMode
()
&
(
S
biStreamFlags
::
Binary
|
SbiStreamFlags
::
Input
))
)
{
StarBASIC
::
Error
(
ERRCODE_BASIC_BAD_CHANNEL
);
return
;
...
...
basic/source/runtime/runtime.cxx
Dosyayı görüntüle @
c2ac8569
...
...
@@ -4308,7 +4308,7 @@ void SbiRuntime::StepOPEN( sal_uInt32 nOp1, sal_uInt32 nOp2 )
short
nChan
=
pChan
->
GetInteger
();
OString
aName
(
OUStringToOString
(
pName
->
GetOUString
(),
osl_getThreadTextEncoding
()));
pIosys
->
Open
(
nChan
,
aName
,
static_cast
<
StreamMode
>
(
nOp1
),
static_cast
<
short
>
(
nOp2
),
nBlkLen
);
static_cast
<
SbiStreamFlags
>
(
nOp2
),
nBlkLen
);
Error
(
pIosys
->
GetError
()
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment