Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CommentProcess

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected logger

logger: LoggerEvent

Methods

addHandlerAfterEmptyln

  • addHandlerAfterEmptyln(callback: (e: EventArgs) => void): void

addHandlerAfterEmptylnVerbose

  • addHandlerAfterEmptylnVerbose(callback: (e: EventArgs) => void): void

addHandlerAfterError

addHandlerAfterErrorVerbose

  • addHandlerAfterErrorVerbose(callback: (e: MsgEventAnyArgs) => void): void

addHandlerAfterWarn

addHandlerAfterWarnVerbose

addHandlerAfterWrite

addHandlerAfterWriteVerbose

  • addHandlerAfterWriteVerbose(callback: (e: MsgEventAnyArgs) => void): void

addHandlerAfterWriteln

addHandlerAfterWritelnVerbose

  • addHandlerAfterWritelnVerbose(callback: (e: MsgEventAnyArgs) => void): void

addHandlerBeforeEmptyln

addHandlerBeforeEmptylnVerbose

  • addHandlerBeforeEmptylnVerbose(callback: (e: CancelEventArgs) => void): void

addHandlerBeforeError

addHandlerBeforeErrorVerbose

  • addHandlerBeforeErrorVerbose(callback: (e: MsgEventAnyArgs) => void): void

addHandlerBeforeWarn

addHandlerBeforeWarnVerbose

  • addHandlerBeforeWarnVerbose(callback: (e: MsgEventAnyArgs) => void): void

addHandlerBeforeWrite

addHandlerBeforeWriteVerbose

  • addHandlerBeforeWriteVerbose(callback: (e: MsgEventAnyArgs) => void): void

addHandlerBeforeWriteln

addHandlerBeforeWritelnVerbose

  • addHandlerBeforeWritelnVerbose(callback: (e: MsgEventAnyArgs) => void): void

Private commentHtmlFinal

  • Wraps the results of [[commentHtml]] in html comments marks.

    If there is a single line of comments then that line will have a prefix of <!-- and a suffix of -->.

    If there are multiple lines then <!-- will be the the first line and --> will be the last line.

    see

    [[commentHtml]]

    Parameters

    • biOpt: IBuildIncludeOpt

      The current options. This parameter is an object and will be potentially modified by this method.

    Returns void

Private commentJsAutoFinal

  • Appends multi comment marks before and after the biOpt.lines if needed.

    see

    [[commentJsAuto]]

    Parameters

    • biOpt: IBuildIncludeOpt

      The current options. This parameter is an object and will be potentially modified by this method.

    Returns void

Private commentMultiFinal

  • Appends multi comment marks before and after the biOpt.lines

    see

    [[commentMulti]]

    Parameters

    • biOpt: IBuildIncludeOpt

      The current options. This parameter is an object and will be potentially modified by this method.

    Returns void

Private decodeParam

  • decodeParam(str: string): string
  • Decodes string such as \u2014 to —

    description

    Parameters are read from files with a BUILD_INCLDDE comment. Since the content is read from a file any inline javascript escapes are not automatically converted. This method does such conversions. Unescaps any\\ to \ escaped colons. For Example:

    // BUILD_INCLDDE(./somfile.txt)[text?before=\n&padleft=# \u2014]

    This method decodes the unicode, line breaks and other JavaScript encodings. This converts \n into an acutal new line and \u2014 into an em dash.

    Parameters

    • str: string

      string to decode

    Returns string

Private getCommentHtmlLines

Private getCommentJsAutoLines

Private getCommentMultiLines

  • Builds a string array of lines with multiline comments for the body of a multiline style or JsDoc style.

    IComment.padLeft is applied to the beginning of each line

    IPadding.padLeft is applied before comment

    IPadding.padRight is applied after comment

    Each line in the array is prefixed with * and depending on the paddind space(s) on each side. Indent is appled to the start if each line if indenting is enabled.

    see

    commentMultiFinal

    Parameters

    • biOpt: IBuildIncludeOpt

      The current options. This parameter is an object and will be potentially modified by this method.

    Returns string[]

Private getCommentSingleLines

  • Builds a string array of lines with single line comments

    Parameters

    • biOpt: IBuildIncludeOpt

      The arguments from the options string values.

      If args.comment.padLeft is set it will be applied before * for each line of the comment.

      If args.text.padLeft is set it will be applied after * but before each line of the comment.

      If args.text.padRight is set it will be applied after each line of the comment.

    Returns string[]

isOptionCommentSet

  • Checks opts for comment options and assigns any found options to biOpt

    description

    Potential options are as follows.

    Sets options for biOpt.comment

    type - Indicates the comment type
      type=single or type=1 - single line comment // will be applied.
      type=multi or type=2 - (default) multi line comment will be used.
      type=jsdoc or type=3 - jsdoc comment style block will be used.
    padleft - A string or a number used to set
    padding string that will apply to the left of each line
    before each comment. This can be used as an indent.

    Parameters

    • opts: string[]

      The array of options to search for comment options in

    • biOpt: IBuildIncludeOpt

      The current options. This parameter is an object and will be potentially modified by this method.

    Returns boolean

    true if opts has comment options; Otherwise, false.

processComment

  • Process any comments that are in the current biOpt.Lines and returns an string array of processed lines.

    see

    processCommentFinal

    Parameters

    • biOpt: IBuildIncludeOpt

      The current options. This parameter is an object and will be potentially modified by this method.

    Returns string[]

    a string[] of comment processed lines.

processCommentFinal

  • Depending on the type of comment this method will modify biOpt to put comment marks at the start and end of biOpt.lines

    see

    processComment

    Parameters

    • biOpt: IBuildIncludeOpt

      The current options. This parameter is an object and will be potentially modified by this method.

    Returns void

registerLoggerEvents

  • registerLoggerEvents(loggerEvent: ILogger): void

removeHandlerAfterEmptyln

  • removeHandlerAfterEmptyln(callback: (e: EventArgs) => void): void

removeHandlerAfterEmptylnVerbose

  • removeHandlerAfterEmptylnVerbose(callback: (e: EventArgs) => void): void

removeHandlerAfterError

removeHandlerAfterErrorVerbose

  • removeHandlerAfterErrorVerbose(callback: (e: MsgEventAnyArgs) => void): void

removeHandlerAfterWarn

removeHandlerAfterWarnVerbose

  • removeHandlerAfterWarnVerbose(callback: (e: MsgEventAnyArgs) => void): void

removeHandlerAfterWrite

removeHandlerAfterWriteVerbose

  • removeHandlerAfterWriteVerbose(callback: (e: MsgEventAnyArgs) => void): void

removeHandlerAfterWriteln

removeHandlerAfterWritelnVerbose

  • removeHandlerAfterWritelnVerbose(callback: (e: MsgEventAnyArgs) => void): void

removeHandlerBeforeEmptyln

removeHandlerBeforeEmptylnVerbose

  • removeHandlerBeforeEmptylnVerbose(callback: (e: CancelEventArgs) => void): void

removeHandlerBeforeError

removeHandlerBeforeErrorVerbose

  • removeHandlerBeforeErrorVerbose(callback: (e: MsgEventAnyArgs) => void): void

removeHandlerBeforeWarn

removeHandlerBeforeWarnVerbose

  • removeHandlerBeforeWarnVerbose(callback: (e: MsgEventAnyArgs) => void): void

removeHandlerBeforeWrite

removeHandlerBeforeWriteVerbose

  • removeHandlerBeforeWriteVerbose(callback: (e: MsgEventAnyArgs) => void): void

removeHandlerBeforeWriteln

removeHandlerBeforeWritelnVerbose

  • removeHandlerBeforeWritelnVerbose(callback: (e: MsgEventAnyArgs) => void): void

unRegisterLoggerEvents

  • unRegisterLoggerEvents(loggerEvent: ILogger): void

Generated using TypeDoc