summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorspf13 <steve.francia@gmail.com>2014-11-04 00:28:20 -0500
committerspf13 <steve.francia@gmail.com>2014-11-04 00:28:20 -0500
commitad69374f8b132f0afddb9203300c600b9f21386b (patch)
treed2eed81bead5d9efec9156cdb70c43853aa89d4a /source
parentdcea0fa5ce125d1a9009b5e5b8a38f00c57bcee9 (diff)
Source files can provide content as String or Bytes or Reader
Diffstat (limited to 'source')
-rw-r--r--source/file.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/file.go b/source/file.go
index ce1469d5d..909d457db 100644
--- a/source/file.go
+++ b/source/file.go
@@ -39,6 +39,14 @@ func (f *File) UniqueId() string {
return f.uniqueId
}
+func (f *File) String() string {
+ return helpers.ReaderToString(f.Contents)
+}
+
+func (f *File) Bytes() []byte {
+ return helpers.ReaderToBytes(f.Contents)
+}
+
// Filename without extension
func (f *File) BaseFileName() string {
return helpers.Filename(f.LogicalName())