Permalink
Browse files

Format nazi - newline driller.

  • Loading branch information...
melezov committed May 31, 2012
1 parent 39b747e commit f02a8ba53eb41ddbc308064aaed0bcc5ee5bd4c2
Showing with 592 additions and 616 deletions.
  1. +5 −5 core/exception-handling.scala
  2. +4 −4 core/src/main/scala/scalax/io/ByteBlock.scala
  3. +1 −1 core/src/main/scala/scalax/io/CloseableIterator.scala
  4. +1 −1 core/src/main/scala/scalax/io/CompositeIterable.scala
  5. +6 −6 core/src/main/scala/scalax/io/Input.scala
  6. +14 −14 core/src/main/scala/scalax/io/JavaConverters.scala
  7. +1 −1 core/src/main/scala/scalax/io/Line.scala
  8. +12 −12 core/src/main/scala/scalax/io/LineTraversable.scala
  9. +45 −45 core/src/main/scala/scalax/io/LongTraversableLike.scala
  10. +2 −3 core/src/main/scala/scalax/io/Output.scala
  11. +2 −2 core/src/main/scala/scalax/io/OutputConverter.scala
  12. +1 −3 core/src/main/scala/scalax/io/ReadChars.scala
  13. +28 −28 core/src/main/scala/scalax/io/ResourceContext.scala
  14. +18 −18 core/src/main/scala/scalax/io/ResourceTraversable.scala
  15. +1 −1 core/src/main/scala/scalax/io/ScalaIOException.scala
  16. +0 −1 core/src/main/scala/scalax/io/Seekable.scala
  17. +2 −2 core/src/main/scala/scalax/io/SeekableByteChannel.scala
  18. +0 −2 core/src/main/scala/scalax/io/WriteChars.scala
  19. +2 −2 core/src/main/scala/scalax/io/extractor/FileChannelExtractor.scala
  20. +1 −1 core/src/main/scala/scalax/io/extractor/ReadableByteChannelExtractor.scala
  21. +1 −1 core/src/main/scala/scalax/io/extractor/WritableChannelExtractor.scala
  22. +7 −7 core/src/main/scala/scalax/io/managed/ByteChannelResource.scala
  23. +4 −4 core/src/main/scala/scalax/io/managed/InputStreamResource.scala
  24. +3 −3 core/src/main/scala/scalax/io/managed/OutputStreamResource.scala
  25. +4 −4 core/src/main/scala/scalax/io/managed/ReadableByteChannelResource.scala
  26. +4 −4 core/src/main/scala/scalax/io/managed/ReaderResource.scala
  27. +6 −7 core/src/main/scala/scalax/io/managed/SeekableByteChannelResource.scala
  28. +2 −2 core/src/main/scala/scalax/io/managed/WritableByteChannelResource.scala
  29. +3 −3 core/src/main/scala/scalax/io/managed/WriterResource.scala
  30. +11 −11 core/src/main/scala/scalax/io/processing/ByteProcessorAPI.scala
  31. +3 −3 core/src/main/scala/scalax/io/processing/CharProcessorAPI.scala
  32. +1 −1 core/src/main/scala/scalax/io/processing/OutputProcessor.scala
  33. +3 −3 core/src/main/scala/scalax/io/processing/Processor.scala
  34. +19 −19 core/src/main/scala/scalax/io/processing/ProcessorAPI.scala
  35. +1 −1 core/src/main/scala/scalax/io/processing/ProcessorTransformer.scala
  36. +2 −2 core/src/main/scala/scalax/io/processing/SeekableProcessor.scala
  37. +5 −5 core/src/main/scala/scalax/io/processing/SpecializedBufferedIterator.scala
  38. +2 −3 core/src/main/scala/scalax/io/processing/SpecificApiFactory.scala
  39. +1 −1 core/src/main/scala/scalax/io/processing/WriteCharsProcessor.scala
  40. +1 −1 core/src/main/scala/scalax/io/support/DeletingFileOutputStream.scala
  41. +8 −8 core/src/main/scala/scalax/io/support/FileUtils.scala
  42. +1 −1 core/src/main/scala/scalax/io/support/Misc.scala
  43. +0 −1 core/src/main/scala/scalax/io/support/NioByteBufferIterator.scala
  44. +1 −1 core/src/main/scala/scalax/io/traversable/ByteResourceTraversable.scala
  45. +3 −3 core/src/main/scala/scalax/io/traversable/ChannelBlockLongTraversable.scala
  46. +1 −1 core/src/main/scala/scalax/io/traversable/ReadableByteChannelResourceTraversable.scala
  47. +1 −1 core/src/main/scala/scalax/io/traversable/ReaderResourceTraversable.scala
  48. +3 −3 core/src/main/scala/scalax/io/traversable/Sliceable.scala
  49. +1 −1 core/src/main/scala/scalax/io/unmanaged/ReadableByteChannelResource.scala
  50. +1 −1 core/src/main/scala/scalax/io/unmanaged/WriterResource.scala
  51. +1 −1 core/src/main/scala/scalax/io/unmanaged/package.scala
  52. +8 −8 core/src/samples/scala/InputComposition.scala
  53. +1 −1 core/src/samples/scala/access-segment-of-input.scala
  54. +6 −6 core/src/samples/scala/asFooConverter.scala
  55. +1 −1 core/src/samples/scala/basic-read-write.scala
  56. +1 −1 core/src/samples/scala/longTraversable-as-seq.scala
  57. +13 −13 core/src/samples/scala/processing.scala
  58. +1 −1 core/src/samples/scala/resources.scala
  59. +1 −1 core/src/test/scala/scalaio/test/ArrayBufferSeekableTests.scala
  60. +1 −1 core/src/test/scala/scalaio/test/CloseActionTest.scala
  61. +4 −4 core/src/test/scala/scalaio/test/DataIndependentongTraversableTest.scala
  62. +1 −1 core/src/test/scala/scalaio/test/ErrorHandlingTestContext.scala
  63. +8 −8 core/src/test/scala/scalaio/test/LongTraversableTest.scala
  64. +1 −1 core/src/test/scala/scalaio/test/LongTraversableViewTest.scala
  65. +1 −1 core/src/test/scala/scalaio/test/OutputStreamResourceTest.scala
  66. +2 −2 core/src/test/scala/scalaio/test/ProcessorTest.scala
  67. +6 −6 core/src/test/scala/scalaio/test/ResourceTest.scala
  68. +1 −1 core/src/test/scala/scalaio/test/SeekableTestUtils.scala
  69. +2 −2 core/src/test/scala/scalaio/test/UnmanagedResourceTests.scala
  70. +0 −1 core/src/test/scala/scalaio/test/channel/InputTest.scala
  71. +1 −1 core/src/test/scala/scalaio/test/channel/SeekableBackedInputTest.scala
  72. +0 −1 core/src/test/scala/scalaio/test/stream/InputTest.scala
  73. +1 −1 core/src/test/scala/scalax/io/ResourceTraversableTest.scala
  74. +3 −3 core/src/test/scala/scalax/test/sugar/AssertionSugar.scala
  75. +3 −3 documentation/src/main/example_projects/example-maven-project/src/main/scala/Main.scala
  76. +3 −3 documentation/src/main/example_projects/example-sbt-project/src/main/scala/Main.scala
  77. +1 −1 documentation/src/main/scala/ScalaIOExample.scala
  78. +6 −6 documentation/src/main/scala/ShapefileDatastore.scala
  79. +2 −2 file/src/main/scala/scalax/file/Exceptions.scala
  80. +5 −6 file/src/main/scala/scalax/file/FileOps.scala
  81. +0 −1 file/src/main/scala/scalax/file/FileSystem.scala
  82. +11 −11 file/src/main/scala/scalax/file/Path.scala
  83. +8 −8 file/src/main/scala/scalax/file/PathSet.scala
  84. +6 −6 file/src/main/scala/scalax/file/PathSetLike.scala
  85. +0 −1 file/src/main/scala/scalax/file/PathURLStreamHandlerFactory.scala
  86. +0 −2 file/src/main/scala/scalax/file/attributes/file_attributes.scala
  87. +3 −3 file/src/main/scala/scalax/file/defaultfs/DefaultFileOps.scala
  88. +9 −9 file/src/main/scala/scalax/file/path-set.scala
  89. +3 −3 file/src/main/scala/scalax/file/ramfs/RamPath.scala
  90. +5 −5 file/src/samples/scala/PathsToJavaFile.scala
  91. +1 −1 file/src/samples/scala/create-paths.scala
  92. +6 −6 file/src/samples/scala/creating-pathsets.scala
  93. +2 −2 file/src/samples/scala/file-locking-and-block-execution.scala
  94. +1 −1 file/src/samples/scala/path-matching.scala
  95. +11 −11 file/src/samples/scala/read-write-files.scala
  96. +7 −7 file/src/samples/scala/using-pathsets.scala
  97. +9 −9 file/src/test/scala/scalaio/test/fs/FsAccessSetTests.scala
  98. +9 −9 file/src/test/scala/scalaio/test/fs/FsBasicPathTests.scala
  99. +11 −11 file/src/test/scala/scalaio/test/fs/FsPathSetTests.scala
  100. +0 −1 file/src/test/scala/scalaio/test/fs/defaultfs/AllTests.scala
  101. +0 −1 file/src/test/scala/scalaio/test/fs/ram/BackSlashTests.scala
  102. +0 −1 file/src/test/scala/scalaio/test/fs/ram/ForwardSlashTests.scala
  103. +1 −1 perf/src/main/scala/scalax/io/perf/AbstractFileSeekableTest.scala
  104. +1 −1 perf/src/main/scala/scalax/io/perf/AbstractInputTest.scala
  105. +1 −1 perf/src/main/scala/scalax/io/perf/AbstractOutputTest.scala
  106. +1 −1 perf/src/main/scala/scalax/io/perf/AbstractReadCharsTest.scala
  107. +1 −1 perf/src/main/scala/scalax/io/perf/AbstractReadableByteChannelInputTest.scala
  108. +1 −1 perf/src/main/scala/scalax/io/perf/AbstractSeekableTest.scala
  109. +1 −1 perf/src/main/scala/scalax/io/perf/AbstractWritableByteChannelOutputTest.scala
  110. +1 −1 perf/src/main/scala/scalax/io/perf/AbstractWriteCharsTest.scala
  111. +1 −1 perf/src/main/scala/scalax/io/perf/CountFunction.scala
  112. +1 −1 perf/src/main/scala/scalax/io/perf/Main.scala
  113. +3 −3 perf/src/main/scala/scalax/io/perf/NullOutputStream.scala
  114. +10 −10 perf/src/main/scala/scalax/io/perf/PerformanceSuite.scala
  115. +1 −1 perf/src/main/scala/scalax/io/perf/SmallDataSet.scala
  116. +1 −1 perf/src/main/scala/scalax/io/perf/SmallMediumDataSet.scala
  117. +1 −1 perf/src/main/scala/scalax/io/perf/Utils.scala
  118. +1 −1 perf/src/main/scala/scalax/io/perf/channel/FileBase.scala
  119. +1 −1 perf/src/main/scala/scalax/io/perf/channel/MemoryBase.scala
  120. +1 −1 perf/src/main/scala/scalax/io/perf/channel/SeekableBase.scala
  121. +1 −1 perf/src/main/scala/scalax/io/perf/channel/input/Input.scala
  122. +17 −18 perf/src/main/scala/scalax/io/perf/channel/output/Output.scala
  123. +1 −1 perf/src/main/scala/scalax/io/perf/file/CopyFiles.scala
  124. +1 −2 perf/src/main/scala/scalax/io/perf/iterator/CloseableIteratorPerformanceTest.scala
  125. +1 −1 perf/src/main/scala/scalax/io/perf/reader/FileBase.scala
  126. +12 −12 perf/src/main/scala/scalax/io/perf/reader/Input.scala
  127. +1 −1 perf/src/main/scala/scalax/io/perf/reader/MemoryBase.scala
  128. +5 −5 perf/src/main/scala/scalax/io/perf/seekable/AbstractArrayBufferSeekableTest.scala
  129. +2 −2 perf/src/main/scala/scalax/io/perf/seekable/PerformanceSuite.scala
  130. +1 −1 perf/src/main/scala/scalax/io/perf/stream/FileBase.scala
  131. +1 −1 perf/src/main/scala/scalax/io/perf/stream/MemoryBase.scala
  132. +12 −12 perf/src/main/scala/scalax/io/perf/stream/input/Input.scala
  133. +15 −16 perf/src/main/scala/scalax/io/perf/stream/output/Output.scala
  134. +1 −1 perf/src/main/scala/scalax/io/perf/writer/FileBase.scala
  135. +1 −1 perf/src/main/scala/scalax/io/perf/writer/MemoryBase.scala
  136. +15 −16 perf/src/main/scala/scalax/io/perf/writer/Output.scala
  137. +8 −8 project/Build.scala
  138. +5 −5 project/Example.scala
  139. +2 −2 project/ExampleProjects.scala
  140. +3 −3 project/Keyword.scala
  141. +7 −7 project/PerformanceReport.scala
  142. +1 −1 project/StopWords.scala
  143. +14 −15 project/WebsiteModel.scala
@@ -48,12 +48,12 @@ object ExceptionHandling {
* is also known so a default value can be provided.
* </p><p>
* This pattern can be quite tricky because the internals of how Scala-IO works needs to be known.
* For example if providing a default for slurpString then one must know that bytes must be
* returned as the default rather than a string.
* For example if providing a default for slurpString then one must know that bytes must be
* returned as the default rather than a string.
* </p>
* <p>
* Also if the scala-io implementation changes the code could break. Defaults work better when
* working with acquireAndGet or acquireFor
* working with acquireAndGet or acquireFor
* </p>
*/
def returnDefaultValueOnFailure {
@@ -113,15 +113,15 @@ object ExceptionHandling {
override def openErrorHandler[A, U](f: A => U, openException: Throwable): Option[U] = {
f match {
case f: FunctionWithDefault[_, U] =>
// perform logging
// perform logging
Some(f.defaultValue)
case _ => super.openErrorHandler(f, openException)
}
}
override def errorHandler[A, U](f: A => U, accessResult: Either[Throwable, U], closingExceptions: List[Throwable]): U = {
f match {
case f: FunctionWithDefault[_, U] =>
// perform logging
// perform logging
f.defaultValue
case _ => super.errorHandler(f, accessResult, closingExceptions)
}
@@ -5,14 +5,14 @@ trait ByteBlock {
def apply(i: Int): Byte
def size: Int
def force:ByteBlock = new ByteBlock {
val data = self.toSeq
val data = self.toSeq
override val force = this
override val toSeq = data
override val toIterator = data.toIterator
val size = data.size
def apply(i:Int) = data(i)
}
def toSeq = toIterator.foldLeft(Seq[Byte]())((acc,next) => acc :+ next)
def toIterator = new Iterator[Byte] {
private[this] val _size = self.size
@@ -21,7 +21,7 @@ trait ByteBlock {
pos += 1
self.apply(pos - 1)
}
def hasNext =
def hasNext =
pos < _size
}
}
}
@@ -189,4 +189,4 @@ private[io] class InitIterator[@specialized(Byte) +A](iter:CloseableIterator[A])
}
def doClose = iter.close()
}
}
@@ -25,4 +25,4 @@ class CompositeIterable[A](builderIterators: Seq[() => Iterator[A]]) {
}
}
}
}
}
@@ -36,7 +36,7 @@ import java.io.{InputStream, File}
trait Input {
/**
* Get the Resource context that configures how the underlying resource is accessed
*
*
* @return the associated ResourceContext
*/
def context:ResourceContext
@@ -54,19 +54,19 @@ trait Input {
* @return an non-strict traversable over all the bytes
*/
def bytes : LongTraversable[Byte]
/**
* Read the input as blocks of bytes. This method should be avoided unless the maximum performance is
* absolutely required because bytes provides very good performance and is a better API for most applications.
*
*
* However since it better reflects how data is read with most input sources (like InputStreams and ReadableByteChannels);
* blocks is slightly more performance than bytes and therefore
* can be used when performance is the most important consideration.
*
*
* @param blockSize block size can optionally be specified but the default is normally acceptable.
*/
def blocks(blockSize: Option[Int] = None): LongTraversable[ByteBlock]
/**
* Obtains a Traversable for conveniently processing the file as Ints.
*
@@ -134,5 +134,5 @@ trait Input {
* The codec representing the desired encoding of the characters
*/
def slurpString(implicit codec: Codec = Codec.default) = new String(byteArray, codec.name)
}
@@ -142,7 +142,7 @@ object JavaConverters {
*/
implicit def asOutputConverter[B](src:B)(implicit converter:AsOutputConverter[B]) =
new AsOutput(converter.toOutput(src))
/**
* Used by the [[scalax.io.Output]] object for converting an arbitrary object to an Output Object
*
@@ -151,13 +151,13 @@ object JavaConverters {
trait AsOutputConverter[-A] {
def toOutput(t:A) : Output
}
/**
* contains several implementations of [[scalax.io.AsOutputConverter]]. They will be implicitly resolved allowing
* a user of the library to simple call A.asOutput and the converter will be found without the user needing to look up these classes
*/
object AsOutputConverter {
/**
* Converts a File to an Output object
*/
@@ -178,7 +178,7 @@ object JavaConverters {
def toOutput(chan: WritableByteChannel) = Resource.fromWritableByteChannel(chan)
}
}
class AsBinaryReadChars(op: Codec => ReadChars) {
/** An object to an ReadChars object */
def asBinaryReadChars(implicit codec:Codec = Codec.default): ReadChars = op(codec)
@@ -192,7 +192,7 @@ object JavaConverters {
implicit def asReadCharsConverter[B](src:B)(implicit converter:AsBinaryReadCharsConverter[B]) =
new AsBinaryReadChars(codec => converter.toReadChars(src,codec))
/**
* Used by the [[scalax.io.ReadChars]] object for converting an arbitrary object to an ReadChars Object
*
@@ -201,7 +201,7 @@ object JavaConverters {
trait AsBinaryReadCharsConverter[-A] {
def toReadChars(t:A,codec:Codec) : ReadChars
}
/**
* contains several implementations of [[scalax.io.AsReadCharsConverterFromBinary]]. They will be implicitly resolved allowing
* a user of the library to simple call A.asBinaryReadChars and the converter will be found without the user needing to look up these classes
@@ -297,7 +297,7 @@ object JavaConverters {
implicit def asSeekableConverter[B](src:B)(implicit converter:AsSeekableConverter[B]) =
new AsSeekable(converter.toSeekable(src))
/**
* Used by the [[scalax.io.Seekable]] object for converting an arbitrary object to an Seekable Object
*
@@ -306,13 +306,13 @@ object JavaConverters {
trait AsSeekableConverter[-A] {
def toSeekable(t:A) : Seekable
}
/**
* contains several implementations of [[scalax.io.AsSeekableConverter]]. They will be implicitly resolved allowing
* a user of the library to simple call A.asSeekable and the converter will be found without the user needing to look up these classes
*/
object AsSeekableConverter {
/**
* Converts a File to an Seekable object
*/
@@ -351,7 +351,7 @@ object JavaConverters {
*/
implicit def asWriteCharsConverter[B](src:B)(implicit converter:AsBinaryWriteCharsConverter[B]) =
new AsBinaryWriteChars(codec => converter.toWriteChars(src,codec))
/**
* Used by the [[scalax.io.WriteChars]] object for converting an arbitrary object to an WriteChars Object
*
@@ -360,13 +360,13 @@ object JavaConverters {
trait AsBinaryWriteCharsConverter[-A] {
def toWriteChars(t:A,codec:Codec) : WriteChars
}
/**
* contains several implementations of [[scalax.io.AsWriteCharsConverter]]. They will be implicitly resolved allowing
* a user of the library to simple call A.asWriteChars and the converter will be found without the user needing to look up these classes
*/
object AsBinaryWriteCharsConverter {
/**
* Converts a File to an WriteChars object
*/
@@ -573,7 +573,7 @@ object JavaConverters {
def toUnmanagedReadChars(reader: Reader) = new unmanaged.ReaderResource(reader)
}
}
class AsUnmanagedBinaryWriteChars(op: (Codec) => WriteChars) {
/** An object to an WriteChars object */
def asUnmanagedBinaryWriteChars(implicit codec:Codec = Codec.default): WriteChars = op(codec)
@@ -644,4 +644,4 @@ object JavaConverters {
def toUnmanagedWriteChars(writer: Writer) = new unmanaged.WriterResource(writer)
}
}
}
}
@@ -25,7 +25,7 @@ object Line {
* It can detect N,R and RN line terminators
*/
case object Auto extends Terminator
abstract class SimpleTerminator(val sep:String) extends Terminator
/*
* The \n line terminator
@@ -24,13 +24,13 @@ class LineTraversable(source: => CloseableIterator[Char], terminator: Terminator
def context = resourceContext
protected[io] def iterator = terminator match {
case Auto => new AutoCharIter(source,includeTerminator)
case t:SimpleTerminator if t.sep.size == 1 => new SingleCharIter(source, t.sep.head, includeTerminator)
case t:SimpleTerminator => new MultiCharIter(source, t.sep, includeTerminator)
case t:SimpleTerminator if t.sep.size == 1 => new SingleCharIter(source, t.sep.head, includeTerminator)
case t:SimpleTerminator => new MultiCharIter(source, t.sep, includeTerminator)
}
}
private[io] class SingleCharIter(private[this] val sourceIter: CloseableIterator[Char],
private[this] val term:Char,
private[io] class SingleCharIter(private[this] val sourceIter: CloseableIterator[Char],
private[this] val term:Char,
private[this] val includeTerm:Boolean) extends CloseableIterator[String] {
private[this] val sb = new StringBuilder
@@ -50,12 +50,12 @@ private[io] class SingleCharIter(private[this] val sourceIter: CloseableIterator
if(includeTerm) sb append term
sb.toString
}
def doClose = sourceIter.close()
}
private[io] class MultiCharIter(private[this] val sourceIter: CloseableIterator[Char],
private[this] val term:String,
private[io] class MultiCharIter(private[this] val sourceIter: CloseableIterator[Char],
private[this] val term:String,
private[this] val includeTerm:Boolean) extends CloseableIterator[String] {
private[this] val sb = new StringBuilder
@@ -79,12 +79,12 @@ private[io] class MultiCharIter(private[this] val sourceIter: CloseableIterator[
def doClose = sourceIter.close()
}
private[io] class AutoCharIter(private[this] val sourceIter: CloseableIterator[Char],
private[io] class AutoCharIter(private[this] val sourceIter: CloseableIterator[Char],
private[this] val includeTerm:Boolean) extends CloseableIterator[String] {
private[this] val sb = new StringBuilder
private[this] val iter = new CharBufferedIterator(sourceIter)
private[this] val iter = new CharBufferedIterator(sourceIter)
@inline
private[this] final def getc() = {
if(iter.hasNext) {
@@ -95,7 +95,7 @@ private[io] class AutoCharIter(private[this] val sourceIter: CloseableIterator[C
iter.next
"\r\n"
} else {
"\r"
"\r"
}
}
else {
@@ -139,4 +139,4 @@ private class CharBufferedIterator(private[this] val sourceIter: CloseableIterat
hdDefined = false
hd
} else sourceIter.next()
}
}
Oops, something went wrong.

0 comments on commit f02a8ba

Please sign in to comment.