CodeGen
[ class tree: CodeGen ] [ index: CodeGen ] [ all elements ]

Class: CodeGen_Tools_Indent

Source Location: /CodeGen-1.0.7/CodeGen/Tools/Indent.php

Class Overview


Wrapper class for whitespace related stuff


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2005-2008 Hartmut Holzgraefe

Methods


Child classes:

CodeGen_Tools_IndentC
C/C++ code specific extension of the Indent class

Inherited Variables

Inherited Methods


Class Details

[line 36]
Wrapper class for whitespace related stuff

all methods are actually static, the class is just needed for namespace emulation to conform with PEAR naming conventions



[ Top ]


Method Detail

dosify   [line 134]

void dosify( string $text, string 1)

Change to DOS/Windows line terminators
  • Access: public

Parameters:

string   1   —  dos/windows text
string   $text   —  unix text

[ Top ]

indent   [line 82]

string indent( int $level, string $text)

re-indent a block of text
  • Return: indented text
  • Access: public

Overridden in child classes as:

CodeGen_Tools_IndentC::indent()
re-indent a block of text

Parameters:

int   $level   —  number of leading indent spaces
string   $text   —  text to reindent

[ Top ]

linetrim   [line 120]

string linetrim( string $text)

Trim of leading and trailing whitespace-only lines
  • Return: trimmed text
  • Access: public

Parameters:

string   $text   —  text

[ Top ]

tabify   [line 48]

string tabify( string $text, [int $tabsize = 4])

Replace leading blanks with tabs

PHP C coding conventions require tab indention with a tabsize of 4

  • Return: tabified text
  • Access: public

Parameters:

string   $text   —  text to tabify
int   $tabsize   —  tab indention level (default: 4 spaces)

[ Top ]

untabify   [line 67]

string untabify( string $text, [int $tabsize = 4])

Replace leading tabs with blanks

PEAR PHP coding conventions require blank indention with a tabsize of 4

  • Return: untabified text
  • Access: public

Parameters:

string   $text   —  text to untabify
int   $tabsize   —  tab indention level (default: 4 spaces)

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:39:06 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.