Packages

  • package root
    Definition Classes
    root
  • package grizzled

    The Grizzled Scala Library contains a variety of miscellaneous, general purpose utility classes and objects.

    The Grizzled Scala Library contains a variety of miscellaneous, general purpose utility classes and objects.

    The home page for the Grizzled Scala Library is http://software.clapper.org/grizzled-scala/. Please see that page for complete details, including installation instructions.

    Definition Classes
    root
  • package ScalaCompat

    Compatibility definitions for Scala 2.13+ vs.

    Compatibility definitions for Scala 2.13+ vs. Scala 2.12 and lesser. This object is conceptually similar to scala.collection.compat. For Scala 2.12 and earlier, it provides a type alias and compatibility functions for LazyList. For Scala 2.13 and greater, it's empty. Thus, all code can use LazyList throughout.

    Definition Classes
    grizzled
  • package collection

    Some collection-related helpers.

    Some collection-related helpers.

    Definition Classes
    grizzled
  • package config

    Classes and objects to aid in the parsing of INI-style configuration files.

    Classes and objects to aid in the parsing of INI-style configuration files. This package is similar, in concept, to the Python ConfigParser module (though its implementation and capabilities differ quite a bit).

    Definition Classes
    grizzled
  • package datetime
    Definition Classes
    grizzled
  • package file

    File-related classes and utilities.

    File-related classes and utilities. This package is distinguished from the grizzled.io package in that this package operates on files and paths, not on open streams or sources.

    Definition Classes
    grizzled
    See also

    grizzled.io

  • package filter

    Contains various file- and I/O-related filter classes.

  • FileDoesNotExistException
  • Implicits
  • Includer
  • util
  • package io

    I/O-related classes and utilities.

    I/O-related classes and utilities. This package is distinguished from the grizzled.file package in that this package operates on already-open Java InputStream, OutputStream, Reader and Writer objects, and on Scala Source objects.

    See grizzled.file

    Definition Classes
    grizzled
  • package math

    Miscellaneous math and statistics utilities.

    Miscellaneous math and statistics utilities.

    Definition Classes
    grizzled
  • package net

    Network-related utility methods and classes.

    Network-related utility methods and classes.

    Definition Classes
    grizzled
  • package parsing

    Methods and classes useful for parsing various things.

    Methods and classes useful for parsing various things.

    Definition Classes
    grizzled
  • package random
    Definition Classes
    grizzled
  • package security
    Definition Classes
    grizzled
  • package string

    String- and text-related classes.

    String- and text-related classes.

    Definition Classes
    grizzled
  • package util

    Miscellaneous utility functions and methods not otherwise categorized.

    Miscellaneous utility functions and methods not otherwise categorized.

    Definition Classes
    grizzled
  • package zip

    The grizzled.zip package contains classes and functions to make it easier to operate on zip and jar files.

    The grizzled.zip package contains classes and functions to make it easier to operate on zip and jar files.

    Definition Classes
    grizzled

package file

File-related classes and utilities. This package is distinguished from the grizzled.io package in that this package operates on files and paths, not on open streams or sources.

See also

grizzled.io

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. file
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class FileDoesNotExistException extends Exception
  2. class Includer extends Iterator[String]

    Process "include" directives in files, returning an iterator over lines from the flattened files.

    Process "include" directives in files, returning an iterator over lines from the flattened files.

    The grizzled.file.Includer class can be used to process "include" directives within a text file, returning a file-like object. It also contains some utility functions that permit using include-enabled files in other contexts.

    WARNING: This class is not thread-safe.

    Syntax

    The include syntax is defined by a regular expression; any line that matches the regular expression is treated as an include directive. The default regular expression, %include\s"(["]+)"$ matches include directives like this:

    %include "/absolute/path/to/file"
    %include "../relative/path/to/file"
    %include "local_reference"
    %include "http://localhost/path/to/my.config"

    Relative and local file references are relative to the including file or URL. That is, if an Includer is processing file "/home/bmc/foo.txt" and encounters an attempt to include file "bar.txt", it will assume "bar.txt" is to be found in "/home/bmc".

    Similarly, if an Includer is processing URL "http://localhost/bmc/foo.txt" and encounters an attempt to include file "bar.txt", it will assume "bar.txt" is to be found at "http://localhost/bmc/bar.txt".

    Nested includes are permitted; that is, an included file may, itself, include other files. The maximum recursion level is configurable and defaults to 100.

    The include syntax can be changed by passing a different regular expression to the Includer constructor.

    Usage

    This package provides an Includer class, which processes include directives in a file and behaves somewhat like a Scala Source. See the class documentation for more details.

    The package also provides a preprocess() convenience function, via a companion object, that can be used to preprocess a file; it returns the path to the resulting preprocessed file.

    Examples

    Preprocess a file containing include directives, then read the result:

    import grizzled.file.Includer
    
    Includer(path).foreach(println(_))

    Use an include-enabled file with a Scala scala.io.Source object:

    import grizzled.file.includer.Includer
    import scala.io.Source
    
    val source = Source.fromFile(Includer.preprocess("/path/to/file"))

Value Members

  1. object Implicits

    Enrichment classes for File objects and the like.

  2. object Includer

    Companion object for the Includer class.

    Companion object for the Includer class. Also contains some utility methods, such as the preprocess() method.

  3. object util

    Useful file-related utility functions.

Inherited from AnyRef

Inherited from Any

Ungrouped