txt

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Copyright 2024 kenita8

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInternal = errors.New("an internal error has occurred")
)

Functions

This section is empty.

Types

type Filer

type Filer interface {
	OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
	Encoding(name string) (encoding.Encoding, error)
	NewReader(f io.Reader, enc encoding.Encoding) io.ReadCloser
	NewWriter(f io.Writer, enc encoding.Encoding) io.WriteCloser
	Close(f io.Closer) error
}

type TxtFile

type TxtFile struct {
	Filer    Filer
	TxtFiler TxtFiler
	Pathname string
	EncName  string
	Fp       io.ReadWriteCloser
	Rc       io.ReadCloser
	Wc       io.WriteCloser
	// contains filtered or unexported fields
}

func NewTxtFile

func NewTxtFile(pathname string, encoding string) *TxtFile

func (*TxtFile) Basename

func (r *TxtFile) Basename() string

func (*TxtFile) Close

func (r *TxtFile) Close()

func (*TxtFile) Extension

func (r *TxtFile) Extension() string

func (*TxtFile) Filename

func (r *TxtFile) Filename() string

func (*TxtFile) OpenReadMode

func (r *TxtFile) OpenReadMode() error

func (*TxtFile) OpenReadModeInternal

func (r *TxtFile) OpenReadModeInternal() error

func (*TxtFile) OpenWriteMode

func (r *TxtFile) OpenWriteMode() error

func (*TxtFile) OpenWriteModeInternal

func (r *TxtFile) OpenWriteModeInternal() error

func (*TxtFile) ReadOneLine

func (r *TxtFile) ReadOneLine() ([]string, error)

func (*TxtFile) WriteOneLine

func (r *TxtFile) WriteOneLine([]string) error

type TxtFiler

type TxtFiler interface {
	Basename() string
	Filename() string
	OpenReadMode() error
	OpenReadModeInternal() error
	ReadOneLine() ([]string, error)
	OpenWriteMode() error
	OpenWriteModeInternal() error
	WriteOneLine([]string) error
	Close()
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL