See changelog 20000321 21:10

This commit is contained in:
Luiz Rafael Culik
2000-03-22 02:48:06 +00:00
parent 5d46ade469
commit 16bd10a8d0
4 changed files with 98 additions and 59 deletions

View File

@@ -617,12 +617,15 @@ HB_FUNC( DIRECTORY )
if( pos )
strcpy( filename, ++pos );
}
#elif defined(__BORLANDC__)
#elif defined(__BORLANDC__) || (__BORLANDC__ >= 1280)
/* NOTE: _chmod( f, 0 ) => Get attribs
_chmod( f, 1, n ) => Set attribs
chmod() though, _will_ change the attributes
*/
attrib = (USHORT)_chmod( fullfile, 0,0 );
chmod() though, _will_ change the attributes */
attrib = (USHORT)_rtl_chmod( fullfile, 0,0 );
#elif defined(__BORLANDC__)
attrib = (USHORT)_chmod( fullfile, 0,0 );
#elif defined(__DJGPP__)
attrib = (USHORT)_chmod( fullfile, 0 );
#else

View File

@@ -55,9 +55,10 @@ CLASS TNortonGuide
METHOD Close()
METHOD WriteParBold( cPar )
METHOD WriteTitle( cTopic , cTitle )
ENDCLASS
METHOD NEW( cFile ) CLASS TNortonGuide
METHOD new( cFile ) class TNortonGuide
IF VALTYPE( cFile ) <> NIL .AND. VALTYPE( cFile ) == "C"
Self:cFile := LOWER( cFile )
@@ -66,7 +67,7 @@ METHOD NEW( cFile ) CLASS TNortonGuide
RETURN Self
METHOD WritePar( cPar,lconv ) CLASS TNortonGuide
METHOD WritePar( cPar,lconv ) class TNortonGuide
DEFAULT lConv to .T.
IF lConv
FWRITE( Self:nHandle, HB_OEMTOANSI( cPar ) + CRLF )
@@ -74,17 +75,17 @@ METHOD WritePar( cPar,lconv ) CLASS TNortonGuide
FWRITE( Self:nHandle, cPar + CRLF )
ENDIF
RETURN Self
METHOD WriteParBox( cPar ) CLASS TNortonGuide
METHOD WriteParBox( cPar ) class TNortonGuide
FWRITE( Self:nHandle, cPar )
RETURN Self
METHOD WriteParBold( cPar ) CLASS TNortonGuide
METHOD WriteParBold( cPar ) class TNortonGuide
Self:WritePar("")
FWRITE( Self:nHandle, '^b' + HB_OEMTOANSI( cPar ) + '^b^' + CRLF )
Self:WritePar("")
RETURN Self
METHOD WriteTitle( cTopic, cTitle ) CLASS TNortonGuide
METHOD WriteTitle( cTopic, cTitle ) class TNortonGuide
LOCAL cTemp
LOCAL nPos
@@ -98,13 +99,13 @@ METHOD WriteTitle( cTopic, cTitle ) CLASS TNortonGuide
RETURN Self
METHOD CLOSE() CLASS TNortonGuide
METHOD CLOSE() class TNortonGuide
FCLOSE( Self:nHandle )
RETURN Self
METHOD WriteLink( cLink ) CLASS TNortonGuide
METHOD WriteLink( cLink ) class TNortonGuide
FWRITE( Self:nHandle, cLink )

View File

@@ -33,7 +33,7 @@
*
*/
#define CRLF chr(13)+chr(10)
#define CRLF hb_osnewline()
#include 'hbclass.ch'
@@ -53,10 +53,14 @@ CLASS TOs2
METHOD WritePar(cPar)
METHOD WriteLink(cLink)
METHOD ScanLink(cLink)
METHOD WriteJumpLink( cLink,cName,cText )
METHOD Close()
METHOD WriteText(cPar)
METHOD WriteParBold(cPar)
METHOD WriteTitle(cTopic, cTitle )
METHOD DostoOs2Text(cText)
METHOD WriteJumpTitle( cTitle, cTopic )
ENDCLASS
METHOD New( cFile ) CLASS TOs2
@@ -84,10 +88,16 @@ RETURN Self
METHOD WritePar( cPar ) CLASS TOs2
FWRITE( Self:nHandle, ".br"+CRLF+Self:DostoOs2Text( cPar ) + CRLF )
FWRITE( Self:nHandle, Self:DostoOs2Text( cPar ) + CRLF )
RETURN Self
method WriteText(cPar) CLASS TOs2
FWRITE( Self:nHandle, cPar + CRLF )
Return Self
METHOD WriteParBold( cPar ) CLASS TOs2
FWRITE( Self:nHandle, ':p.:hp2.' + ALLTRIM( cPar ) + CRLF +':ehp2.'+ CRLF)
@@ -168,3 +178,26 @@ METHOD DosToOs2Text(cText) CLASS TOs2
Return cReturn
METHOD WriteJumpTitle( cTitle, cTopic ) class TOs2
LOCAL cTemp
LOCAL nPos
LOCAL cWrite
nPos := AT( "()", cTitle )
cTopic := ALLTRIM( HB_OEMTOANSI(cTopic ))
cWrite := ':fn id='+cTopic+'.'
FWRITE( Self:nHandle, cWrite )
Self:WriteParBold( cTopic )
RETURN Self
METHOD WriteJumpLink( cLink,cText ) class TOs2
FWRITE( Self:nHandle, " :link refid="+aLLTRIM( HB_OEMTOANSI(cLink) ) +"reftype=fn."+ cLink+":elink." +cText+ CRLF )
RETURN Self

View File

@@ -44,13 +44,12 @@
*+±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±
*+
CLASS TRTF
DATA cFile
DATA nHandle
METHOD WriteHeader()
METHOD New( cFile )
METHOD WritePar( cPar )
METHOD WriteParText( cPar )
METHOD WritePar( cPar ,cIden)
METHOD WriteParText( cPar ,lConv)
METHOD WriteParNoIndent(cPar)
METHOD WriteParBox(cPar)
METHOD WriteLink( clink )
@@ -62,16 +61,19 @@ CLASS TRTF
METHOD WriteJumpTitle( cTitle, cTopic )
METHOD EndPar()
METHOD EndPage()
ENDCLASS
METHOD NEW( cFile ) CLASS TRTF
METHOD new( cFile ) class TRTF
IF VALTYPE( cFile ) <> NIL .AND. VALTYPE( cFile ) == "C"
Self:cFile := LOWER( cFile )
Self:nHandle := FCREATE( Self:cFile )
ENDIF
RETURN Self
METHOD WriteHeader() CLASS TRTF
METHOD WriteHeader() class TRTF
LOCAL cHeader := '{\rtf1\ansi\pard\fs20' + CRLF + ;
'\deff5{\fonttbl' + CRLF + ;
@@ -93,22 +95,21 @@ METHOD WriteHeader() CLASS TRTF
'}' + CRLF
LOCAL cColortable := '{\colortbl;' + CRLF + ;
'\red0\green0\blue0;' + CRLF + ;
'\red0\green0\blue128;' + CRLF + ;
'\red0\green128\blue128;' + CRLF + ;
'\red0\green128\blue0;' + CRLF + ;
'\red128\green0\blue0;' + CRLF + ;
'\red128\green0\blue128;' + CRLF + ;
'\red128\green128\blue0;' + CRLF + ;
'\red128\green128\blue128;' + CRLF + ;
'\red64\green64\blue64;' + CRLF + ;
'\red0\green0\blue255;' + CRLF + ;
'\red0\green255\blue255;' + CRLF + ;
'\red0\green255\blue0;' + CRLF + ;
'\red255\green0\blue0;' + CRLF + ;
'\red192\green192\blue192;' + CRLF + ;
'\red255\green255\blue0;' + CRLF + ;
'\red255\green255\blue255;' + CRLF + ;
'\red0\green0\blue0;' +CRLF + ;
'\red0\green255\blue255;' +CRLF + ;
'\red255\green0\blue255;' +CRLF + ;
'\red128\green128\blue128;'+CRLF + ;
'\red0\green128\blue0;' +CRLF + ;
'\red0\green255\blue0;' +CRLF + ;
'\red128\green0\blue0;' +CRLF + ;
'\red0\green0\blue128;' +CRLF + ;
'\red128\green128\blue0;' +CRLF + ;
'\red128\green0\blue128;' +CRLF + ;
'\red255\green0\blue0;' +CRLF + ;
'\red192\green192\blue192;'+CRLF + ;
'\red0\green128\blue128;' +CRLF + ;
'\red255\green255\blue255;'+CRLF + ;
'\red255\green255\blue0;'+CRLF + ;
'}' + CRLF
FWRITE( Self:nHandle, cHeader )
@@ -117,23 +118,24 @@ METHOD WriteHeader() CLASS TRTF
RETURN Self
METHOD WritePar( cPar ) CLASS TRTF
METHOD WritePar( cPar ,cIden) class TRTF
default ciDen to ''
cPar:=StrTran(cPar,"{","\{")
cPar:=StrTran(cPar,"}","\}")
FWRITE( Self:nHandle, '\par'+CRLF+ '\pard\cf1\f6\fs20\b0\i0\li300' + HB_OEMTOANSI(cPar )+CRLF)
FWRITE( Self:nHandle, '\par'+CRLF+ '\pard\cf1\f8\fs20\b0\i0'+cIden +" "+ HB_OEMTOANSI(cPar )+CRLF)
RETURN Self
METHOD WriteParNoIndent( cPar ) CLASS TRTF
METHOD WriteParNoIndent( cPar ) class TRTF
cPar:=StrTran(cPar,"{","\{")
cPar:=StrTran(cPar,"}","\}")
FWRITE( Self:nHandle, '\par'+CRLF+ '\pard\cf1\f8\fs20\b0\i0' + HB_OEMTOANSI(cPar) +CRLF)
RETURN Self
METHOD WriteParBox( cPar ) CLASS TRTF
METHOD WriteParBox( cPar ) class TRTF
cPar:=StrTran(cPar,"{","\{")
cPar:=StrTran(cPar,"}","\}")
FWRITE( Self:nHandle, '\par'+CRLF+ '\pard\cf1\f14\b0\i0' + cPar +CRLF)
FWRITE( Self:nHandle, '\par'+CRLF+ '\pard\cf1\f14\b0\i0\fi-710\li710' + cPar +CRLF)
RETURN Self
METHOD WriteParText( cPar,lConv ) CLASS TRTF
METHOD WriteParText( cPar,lConv ) class TRTF
DEFAULT lConv to .T.
cPar:=StrTran(cPar,"{","\{")
cPar:=StrTran(cPar,"}","\}")
@@ -144,32 +146,32 @@ ELSE
ENDIF
RETURN Self
METHOD EndPar() CLASS TRTF
METHOD EndPar() class TRTF
FWRITE( Self:nHandle, '\par' + CRLF )
RETURN Self
METHOD WriteParBold( cPar,lCenter ) CLASS TRTF
METHOD WriteParBold( cPar,lCenter ) class TRTF
DEFAULT lCenter to .F.
cPar:=StrTran(cPar,"{","\{")
cPar:=StrTran(cPar,"}","\}")
if lCenter
FWRITE( Self:nHandle, '\par \pard\qc\cf1\f6\fs30\i\b\li300 ' + ALLTRIM(HB_OEMTOANSI( cPar )) + CRLF )
FWRITE( Self:nHandle, '\par \pard\qc\cf1\f8\fs30\i\b\fi-710\li710 ' + ALLTRIM(HB_OEMTOANSI( cPar )) + CRLF )
else
FWRITE( Self:nHandle, '\par \pard\cf1\f6\fs30\i\b\li300 ' + ALLTRIM(HB_OEMTOANSI( cPar )) + CRLF )
FWRITE( Self:nHandle, '\par \pard\cf1\f8\fs30\i\b\fi-710\li710 ' + ALLTRIM(HB_OEMTOANSI( cPar )) + CRLF )
Endif
RETURN Self
METHOD WriteParBoldText( cPar,cText ) CLASS TRTF
METHOD WriteParBoldText( cPar,cText ) class TRTF
cPar:=StrTran(cPar,"{","\{")
cPar:=StrTran(cPar,"}","\}")
cText:=StrTran(cText,"{","\{")
cText:=StrTran(cText,"}","\}")
FWRITE( Self:nHandle, '\par \pard\cf1\f6\fs20\i\b ' + ALLTRIM(HB_OEMTOANSI( cPar )) + ' \b\cf1\f6\fs20\i0\b0\li300 ' +ALLTRIM(HB_OEMTOANSI(cText)) + CRLF )
FWRITE( Self:nHandle, '\par \pard\cf1\f8\fs20\i\b ' + ALLTRIM(HB_OEMTOANSI( cPar )) + ' \b\cf1\f8\fs20\i0\b0\li300 ' +ALLTRIM(HB_OEMTOANSI(cText)) + CRLF )
RETURN Self
METHOD WriteTitle( cTitle, cTopic ) CLASS TRTF
METHOD WriteTitle( cTitle, cTopic ) class TRTF
LOCAL cTemp
LOCAL nPos
@@ -186,7 +188,7 @@ METHOD WriteTitle( cTitle, cTopic ) CLASS TRTF
cTopic := ALLTRIM( HB_OEMTOANSI(cTopic ))
cWrite := '{\f6' + CRLF + ;
cWrite := '{\f8' + CRLF + ;
' #{\footnote \pard\fs20 # ' + "IDH_"+cTemp + ' }' + CRLF + ;
' ${\footnote \pard\fs20 $ ' + ALLTRIM( cTopic ) + ' }' + CRLF + ;
' K{\footnote \pard\fs20 K ' + ALLTRIM( cTopic ) + ' }' + CRLF + ;
@@ -194,10 +196,10 @@ METHOD WriteTitle( cTitle, cTopic ) CLASS TRTF
FWRITE( Self:nHandle, cWrite )
FWRITE( Self:nHandle, '\pard\qc\cf1\f6\fs30\i\b ' + ALLTRIM(HB_OEMTOANSI( cTopic )) + CRLF )
FWRITE( Self:nHandle, '\pard\qc\cf1\f8\fs30\i\b ' + ALLTRIM(HB_OEMTOANSI( cTopic )) + CRLF )
RETURN Self
METHOD WriteJumpTitle( cTitle, cTopic ) CLASS TRTF
METHOD WriteJumpTitle( cTitle, cTopic ) class TRTF
LOCAL cTemp
LOCAL nPos
@@ -214,7 +216,7 @@ METHOD WriteJumpTitle( cTitle, cTopic ) CLASS TRTF
cTopic := ALLTRIM( HB_OEMTOANSI(cTopic ))
cWrite := '{\f6' + CRLF + ;
cWrite := '{\f8' + CRLF + ;
' #{\footnote \pard\fs20 # ' + "IDH_"+cTemp + ' }' + CRLF + ;
' ${\footnote \pard\fs20 $ ' + ALLTRIM( cTopic ) + ' }' + CRLF + ;
'}' + CRLF
@@ -224,27 +226,27 @@ METHOD WriteJumpTitle( cTitle, cTopic ) CLASS TRTF
Self:WriteParBold( cTopic )
RETURN Self
METHOD EndPage() CLASS TRTF
METHOD EndPage() class TRTF
FWRITE( Self:nHandle,"\par "+CRLF+ '\page' + CRLF )
Return Self
METHOD CLOSE() CLASS TRTF
FWRITE( Self:nHandle, '\page' + CRLF )
METHOD CLOSE() class TRTF
// FWRITE( Self:nHandle, '\page' + CRLF )
// FWRITE( Self:nHandle, '}' + CRLF )
FWRITE( Self:nHandle, '}' + CRLF )
FCLOSE( Self:nHandle )
RETURN Self
METHOD WriteLink( cLink ) CLASS TRTF
METHOD WriteLink( cLink ) class TRTF
FWRITE( Self:nHandle, '\par \pard\cf1\fs20 {\f6\uldb '+ ALLTRIM( HB_OEMTOANSI(cLink) ) + '}{\v\f6 ' + "IDH_"+IF(AT( "()",cLink)>0 , ALLTRIM( HB_OEMTOANSI(STRTRAN( cLink, "()", "xx" ) )),ALLTRIM( HB_OEMTOANSI(STRTRAN( cLink, "@", "x" )) )) + '}' + CRLF )
FWRITE( Self:nHandle, '\par \pard\cf1\fs20 {\f8\uldb '+ ALLTRIM( HB_OEMTOANSI(cLink) ) + '}{\v\f8 ' + "IDH_"+IF(AT( "()",cLink)>0 , ALLTRIM( HB_OEMTOANSI(STRTRAN( cLink, "()", "xx" ) )),ALLTRIM( HB_OEMTOANSI(STRTRAN( cLink, "@", "x" )) )) + '}' + CRLF )
RETURN Self
METHOD WriteJumpLink( cLink,cName,cText ) CLASS TRTF
METHOD WriteJumpLink( cLink,cName,cText ) class TRTF
FWRITE( Self:nHandle, '\par \pard\cf1\fs20 {\f6\ul '+ ALLTRIM( HB_OEMTOANSI(cName) ) + '}{\v\f6 ' + "IDH_"+IF(AT( "()",cLink)>0 , ALLTRIM( HB_OEMTOANSI(STRTRAN( cLink, "()", "xx" ) )),ALLTRIM( HB_OEMTOANSI(STRTRAN( cLink, "@", "x" )) )) + '}'+cText+ CRLF )
FWRITE( Self:nHandle, '\par \pard\cf1\fs20 {\f8\ul '+ ALLTRIM( HB_OEMTOANSI(cName) ) + '}{\v\f8 ' + "IDH_"+IF(AT( "()",cLink)>0 , ALLTRIM( HB_OEMTOANSI(STRTRAN( cLink, "()", "xx" ) )),ALLTRIM( HB_OEMTOANSI(STRTRAN( cLink, "@", "x" )) )) + '}'+cText+ CRLF )
RETURN Self