csv.js
No description.

File Location

/goog/labs/format/csv.js

Classes

goog.labs.format.csv.ParseError
Error thrown when parsing fails.

Public Protected Private

Enumerations

Global Functions

goog.labs.format.csv.assertToken_(o)
Assert the parameter is a token.
Arguments:
o : *
What should be a token.
code »
goog.labs.format.csv.ParseError.findLineInfo_(strindex) ?{line: !goog.string.newlines.Line, lineIndex: number
Calculate the line and column for an index in a string. TODO(nnaze): Consider moving to goog.string.newlines.
Arguments:
str : string
A string.
index : number
An index into the string.
Returns: ?{line: !goog.string.newlines.Line, lineIndex: number  } The line and index of the line.
code »
goog.labs.format.csv.ParseError.getLineDebugString_(strcolumn) string
Get a debug string of a line and a pointing caret beneath it.
Arguments:
str : string
The string.
column : number
The column to point at (1-indexed).
Returns: string  The debug line.
code »
goog.labs.format.csv.isCharacterString_(str) boolean
No description.
Arguments:
str : string
A string.
Returns: boolean  Whether the string is a single character.
code »
goog.labs.format.csv.parse&nextToken() goog.labs.format.csv.Token
No description.
Returns: goog.labs.format.csv.Token  The next token in the stream.
code »
goog.labs.format.csv.parse(textopt_ignoreErrors) !Array.<!Array.<string>>
Parses a CSV string to create a two-dimensional array. This function does not process header lines, etc -- such transformations can be made on the resulting array.
Arguments:
text : string
The entire CSV text to be parsed.
opt_ignoreErrors : boolean=
Whether to ignore parsing errors and instead try to recover and keep going.
Returns: !Array.<!Array.<string>>  The parsed CSV.
code »
goog.labs.format.csv.parse&pushBack(t)
Push a single token into the push-back variable.
Arguments:
t : goog.labs.format.csv.Token
Single token.
code »
goog.labs.format.csv.parse&readField() string | !goog.labs.format.csv.Sentinels_
Read a field from input.
Returns: string | !goog.labs.format.csv.Sentinels_  The field, as a string, or a sentinel (if applicable).
code »
goog.labs.format.csv.parse&readQuotedField() string
Read a quoted field from input.
Returns: string  The field, as a string.
code »
goog.labs.format.csv.parse&readRecord() !Array.<string> | !goog.labs.format.csv.Sentinels_
Read the next record.
Returns: !Array.<string> | !goog.labs.format.csv.Sentinels_  A single record with multiple fields.
code »

Directory format

File Reference