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 ¶
- func GetNextLineFromReader(r *bufio.Reader, comment_char byte) (str string, err error)
- func Int32sFromReader(r *bufio.Reader, comment_char byte) (retval []int32, err error)
- func ParseStringAsInt32s(line string) (retval []int32, idx int)
- func StringsFromReader(r *bufio.Reader, comment_char byte, seperator string) (retval []string, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetNextLineFromReader ¶
return next non-empty / non-commented line from a reader
func Int32sFromReader ¶
return the result of parsing next non-empty/non-commented line from a reader
func ParseStringAsInt32s ¶
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.