fixed-length


License

License

MIT
GroupId

GroupId

com.github.atais
ArtifactId

ArtifactId

fixed-length_2.10
Last Version

Last Version

0.4.1
Release Date

Release Date

Type

Type

jar
Description

Description

fixed-length
fixed-length
Project URL

Project URL

https://github.com/atais/Fixed-Length
Project Organization

Project Organization

com.github.atais
Source Code Management

Source Code Management

https://github.com/atais/Fixed-Length

Download fixed-length_2.10

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.atais/fixed-length_2.10/ -->
<dependency>
    <groupId>com.github.atais</groupId>
    <artifactId>fixed-length_2.10</artifactId>
    <version>0.4.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.atais/fixed-length_2.10/
implementation 'com.github.atais:fixed-length_2.10:0.4.1'
// https://jarcasting.com/artifacts/com.github.atais/fixed-length_2.10/
implementation ("com.github.atais:fixed-length_2.10:0.4.1")
'com.github.atais:fixed-length_2.10:jar:0.4.1'
<dependency org="com.github.atais" name="fixed-length_2.10" rev="0.4.1">
  <artifact name="fixed-length_2.10" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.atais', module='fixed-length_2.10', version='0.4.1')
)
libraryDependencies += "com.github.atais" % "fixed-length_2.10" % "0.4.1"
[com.github.atais/fixed-length_2.10 "0.4.1"]

Dependencies

compile (3)

Group / Artifact Type Version
org.scala-lang : scala-library jar 2.10.6
com.chuusai : shapeless_2.10 jar 2.3.2
org.typelevel : cats-core_2.10 jar 1.1.0

test (2)

Group / Artifact Type Version
org.scalatest : scalatest_2.10 jar 3.0.1
org.scalacheck : scalacheck_2.10 jar 1.13.4

Project Modules

There are no modules declared in this project.

fixed-length Build Status codecov license

A simple Scala library for parsing fixed-length format.

A graceful playground for Shapeless and Cats libraries.

Installation

You can find the fixed-length library on Maven Central

Add the library to your dependencies:

libraryDependencies += "com.github.atais" %% "fixed-length" % "0.3"

Library is cross-compiled for Scala 2.10, 2.11 and 2.12.

Examples

Please find example test scenarios describing simple use cases:

Usage

Describe your class with an Encoder, Decoder or Codec typeclass and Parse away!

Parameters

start: Int

A fixed position in line, where the field begins

end: Int

A fixed position in line, where the field ends

align: Alignment

(default value is Alignment.Left)

Alignment of the field's value in the given area of size end - start

Available options:

  • Alignment.Left
  • Alignment.Right

padding: Char

(default value is ' ')

Fills the remaining space in the given area with the padding Char.

Warning! Wrong selection of padding char may cause decoding issues!

defaultValue: A (Decoder only)

(default value is null)

The default value of a field, which will be used in case of any decoding error.

Warning! This will surpress any decoding errors!

License

Versions

Version
0.4.1
0.4
0.3
0.2
0.1