2011-02-14 01:04 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)

* src/rtl/hbdoc.prg
  * tests/hbdocext.prg
  * tests/hbdoctst.prg
    * Using new core filename handling functions instead of local copies.
This commit is contained in:
Viktor Szakats
2011-02-14 00:05:23 +00:00
parent 1c61148f95
commit 8ac1677385
4 changed files with 11 additions and 43 deletions

View File

@@ -16,6 +16,12 @@
The license applies to all entries newer than 2009-04-28.
*/
2011-02-14 01:04 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* src/rtl/hbdoc.prg
* tests/hbdocext.prg
* tests/hbdoctst.prg
* Using new core filename handling functions instead of local copies.
2011-02-14 00:01 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbnetio/utils/hbnetio/netioeng.prg
* contrib/hbrun/hbrun.prg

View File

@@ -76,7 +76,7 @@ FUNCTION __hbdoc_LoadDir( cDir, cName, aErrMsg )
IF ISCHARACTER( cDir )
cDir := DirAddPathSep( cDir )
cDir := hb_DirSepAdd( cDir )
IF hb_DirExists( cDir + _HBDOC_SRC_SUBDIR )
@@ -202,7 +202,7 @@ STATIC PROCEDURE __hbdoc__read_stream( aEntry, cFile, cFileName, hMeta, aErrMsg
ENDIF
ELSEIF ! Empty( cSection )
IF ! Empty( hEntry[ cSection ] )
hEntry[ cSection ] += Chr( 13 ) + Chr( 10 )
hEntry[ cSection ] += Chr( 13 ) + Chr( 10 )
ENDIF
hEntry[ cSection ] += cLine
ELSEIF ! Empty( cLine )
@@ -217,14 +217,6 @@ STATIC PROCEDURE __hbdoc__read_stream( aEntry, cFile, cFileName, hMeta, aErrMsg
RETURN
STATIC FUNCTION DirAddPathSep( cDir )
IF ! Empty( cDir ) .AND. !( Right( cDir, 1 ) == hb_ps() )
cDir += hb_ps()
ENDIF
RETURN cDir
FUNCTION __hbdoc_ToSource( aEntry )
LOCAL cSource := ""
LOCAL hEntry

View File

@@ -26,7 +26,7 @@ PROCEDURE Main()
FOR EACH aFile IN Directory( hb_osFileMask() )
cFile := __hbdoc_ToSource( __hbdoc_FromSource( MemoRead( aFile[ F_NAME ] ) ) )
IF ! Empty( cFile )
cDst := FNameExtSet( aFile[ F_NAME ], ".txt" )
cDst := hb_FNameExtSet( aFile[ F_NAME ], ".txt" )
IF ! hb_FileExists( cDst )
? "Saving", cDst
hb_MemoWrit( cDst, cHdr + cFile )
@@ -35,10 +35,3 @@ PROCEDURE Main()
NEXT
RETURN
STATIC FUNCTION FNameExtSet( cFileName, cExt )
LOCAL cDir, cName
hb_FNameSplit( cFileName, @cDir, @cName )
RETURN hb_FNameMerge( cDir, cName, cExt )

View File

@@ -37,7 +37,7 @@ PROCEDURE Main( cRoot )
cRoot += ".." + hb_ps()
ENDDO
ELSE
cDir := DirAddPathSep( cDir )
cDir := hb_DirSepAdd( cDir )
ENDIF
OutStd( "Root: " + cRoot + hb_eol() )
@@ -83,7 +83,7 @@ PROCEDURE Main( cRoot )
STATIC FUNCTION DirGetName( cDir )
LOCAL cName
cDir := DirDelPathSep( cDir )
cDir := hb_DirSepDel( cDir )
hb_FNameSplit( cDir,, @cName )
@@ -92,26 +92,3 @@ STATIC FUNCTION DirGetName( cDir )
ENDIF
RETURN cName
STATIC FUNCTION DirDelPathSep( cDir )
IF Empty( hb_osDriveSeparator() )
DO WHILE Len( cDir ) > 1 .AND. Right( cDir, 1 ) == hb_ps()
cDir := hb_StrShrink( cDir, 1 )
ENDDO
ELSE
DO WHILE Len( cDir ) > 1 .AND. Right( cDir, 1 ) == hb_ps() .AND. ;
!( Right( cDir, 2 ) == hb_osDriveSeparator() + hb_ps() )
cDir := hb_StrShrink( cDir, 1 )
ENDDO
ENDIF
RETURN cDir
STATIC FUNCTION DirAddPathSep( cDir )
IF ! Empty( cDir ) .AND. !( Right( cDir, 1 ) == hb_ps() )
cDir += hb_ps()
ENDIF
RETURN cDir