2012-06-27 00:22 UTC+0200 Viktor Szakats (harbour syenar.net)

+ examples/hbdoc/genbase.prg
  - examples/hbdoc/gentpl.prg
  * examples/hbdoc/genhtml.prg
  * examples/hbdoc/hbdoc.hbp
  * examples/hbdoc/hbdoc.prg
    * further cleanups
This commit is contained in:
Viktor Szakats
2012-06-26 22:23:35 +00:00
parent c9852a4876
commit aaefbf3466
5 changed files with 22 additions and 22 deletions

View File

@@ -16,6 +16,14 @@
The license applies to all entries newer than 2009-04-28.
*/
2012-06-27 00:22 UTC+0200 Viktor Szakats (harbour syenar.net)
+ examples/hbdoc/genbase.prg
- examples/hbdoc/gentpl.prg
* examples/hbdoc/genhtml.prg
* examples/hbdoc/hbdoc.hbp
* examples/hbdoc/hbdoc.prg
* further cleanups
2012-06-27 00:09 UTC+0200 Viktor Szakats (harbour syenar.net)
* examples/hbdoc/genhtml.prg
* examples/hbdoc/gentpl.prg

View File

@@ -4,7 +4,7 @@
/*
* Harbour Project source code:
* Document generator template class
* Document generator base class
*
* Copyright 2009 April White <april users.sourceforge.net>
* www - http://harbour-project.org
@@ -103,7 +103,7 @@ METHOD New( cFolder, cFilename, cTitle, cExtension, nType ) CLASS TPLGenerate
::nType := nType
IF ! hb_DirExists( ::cFolder )
OutStd( hb_eol(), "Creating folder " + ::cFolder )
OutStd( hb_eol() + "Creating folder '" + ::cFolder + "'" )
hb_DirCreate( ::cFolder )
ENDIF

View File

@@ -276,9 +276,11 @@ METHOD Append( cText, cFormat ) CLASS GenerateHTML
cResult := StrTran( cResult, Chr( aFormat[ idx ] ), "&" + aFormat[ idx + 1 ] + ";" )
NEXT
aFormat := Split( cFormat, "," )
aFormat := hb_ATokens( cFormat, "," )
FOR idx := Len( aFormat ) TO 1 STEP -1
cResult := "<" + aFormat[ idx ] + ">" + cResult + "</" + aFormat[ idx ] + ">"
IF ! Empty( aFormat[ idx ] )
cResult := "<" + aFormat[ idx ] + ">" + cResult + "</" + aFormat[ idx ] + ">"
ENDIF
NEXT
DO WHILE Right( cResult, Len( hb_eol() ) ) == hb_eol()

View File

@@ -11,10 +11,10 @@
-gtcgi
hbdoc.prg
tmplates.prg
genbase.prg
gentpl.prg
gentxt.prg
genhtml.prg
genxml.prg
tmplates.prg

View File

@@ -1008,26 +1008,16 @@ FUNCTION Parse(cVar, xDelimiter)
RETURN cResult
FUNCTION Split(cVar, xDelimiter)
LOCAL aResult := {}
LOCAL clVar := cVar
DO WHILE Len(clVar) > 0
AAdd(aResult, Parse( @clVar, xDelimiter ) )
ENDDO
RETURN aResult
FUNCTION Join(aVar, cDelimiter)
LOCAL cResult := ""
AEval( aVar, {|c,n| cResult += iif( n > 1, cDelimiter, "" ) + c } )
AEval( aVar, {| c, n | cResult += iif( n > 1, cDelimiter, "" ) + c } )
RETURN cResult
STATIC PROCEDURE AddErrorCondition( cFile, cMessage, nLine )
IF p_hsSwitches[ "immediate-errors" ]
qout( cFile + ":" + HB_NTOS( nLine ) + ": " + cMessage )
OutStd( cFile + ":" + HB_NTOS( nLine ) + ": " + cMessage + hb_eol() )
ENDIF
RETURN
@@ -1040,10 +1030,10 @@ FUNCTION Indent( cText, nLeftMargin, nWidth, lRaw )
hb_default( @lRaw, .F. )
IF nWidth == 0 .or. lRaw
aText := Split( cText, hb_eol() )
aText := hb_ATokens( cText, hb_eol() )
idx := 99999
AEval( aText, {|c| iif( Empty(c), , idx := Min( idx, Len( c ) - Len( LTrim( c ) ) ) ) } )
AEval( aText, {|c,n| aText[ n ] := Space( nLeftMargin ) + SubStr( c, idx + 1 ) } )
AEval( aText, {| c | iif( Empty( c ), , idx := Min( idx, Len( c ) - Len( LTrim( c ) ) ) ) } )
AEval( aText, {| c, n | aText[ n ] := Space( nLeftMargin ) + SubStr( c, idx + 1 ) } )
cResult := Join( aText, hb_eol() ) + hb_eol() + hb_eol()
ELSE
DO WHILE Len( cText ) > 0