line_parser

package
v0.0.0-...-6b870f6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2014 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Overview

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Author: anupam.kapoor@gmail.com (Anupam Kapoor)

implement some convenience routines for parsing input string as a bunch of primitive types

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNextLineFromReader

func GetNextLineFromReader(r *bufio.Reader, comment_char byte) (str string, err error)

return next non-empty / non-commented line from a reader

func Int32sFromReader

func Int32sFromReader(r *bufio.Reader, comment_char byte) (retval []int32, err error)

return the result of parsing next non-empty/non-commented line from a reader

func ParseStringAsInt32s

func ParseStringAsInt32s(line string) (retval []int32, idx int)

parse an input-string into a slice of int32 values, and return index of the first non-int32 field

func StringsFromReader

func StringsFromReader(r *bufio.Reader, comment_char byte, seperator string) (retval []string, err error)

split a non-empty and non-commented line from a reader into a slice of strings, each delimited by a 'seperator'. the returned slice doesn't contain any zero-length strings...

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL