fileinfo

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2021 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmptyWrapperPtr = EmptyWrappers()
)

Functions

This section is empty.

Types

type FileNamesCollection

type FileNamesCollection struct {
	RootPath string

	Error *errorwrapper.Wrapper
	// contains filtered or unexported fields
}

func NewFileNames

func NewFileNames(rootPath string, capacity int) *FileNamesCollection

func NewFileNamesUsing

func NewFileNamesUsing(
	directoryPath, separator string,
	isNormalize bool,
) *FileNamesCollection

func NewFileNamesUsingWrappers

func NewFileNamesUsingWrappers(wrappers *Wrappers) *FileNamesCollection

func (*FileNamesCollection) Add

func (filesNamesCollection *FileNamesCollection) Add(fileName string) *FileNamesCollection

func (*FileNamesCollection) AddWrapper

func (filesNamesCollection *FileNamesCollection) AddWrapper(wrapper Wrapper) *FileNamesCollection

func (*FileNamesCollection) GetFilePaths

func (filesNamesCollection *FileNamesCollection) GetFilePaths(
	separator string,
) *[]string

Root level files paths, no nested paths.

func (*FileNamesCollection) GetRecursiveFilePaths

func (filesNamesCollection *FileNamesCollection) GetRecursiveFilePaths(
	separator string,
) *[]string

Recursive path access, get all recursive files.

func (*FileNamesCollection) HasParentWrappers

func (filesNamesCollection *FileNamesCollection) HasParentWrappers() bool

func (*FileNamesCollection) IsContains

func (filesNamesCollection *FileNamesCollection) IsContains(
	fileName string,
	isCaseSensitive bool,
) bool

func (*FileNamesCollection) IsEmpty

func (filesNamesCollection *FileNamesCollection) IsEmpty() bool

func (*FileNamesCollection) IsParentWrappersEmpty

func (filesNamesCollection *FileNamesCollection) IsParentWrappersEmpty() bool

func (*FileNamesCollection) Length

func (filesNamesCollection *FileNamesCollection) Length() int

func (*FileNamesCollection) OnlyNamesCollection

func (filesNamesCollection *FileNamesCollection) OnlyNamesCollection() *[]string

func (*FileNamesCollection) ParentWrappers

func (filesNamesCollection *FileNamesCollection) ParentWrappers() *Wrappers

type PathsCollection

type PathsCollection struct {
	ErrorWrapper *errorwrapper.Wrapper
	// contains filtered or unexported fields
}

func NewPaths

func NewPaths(rootPath, separator string, capacity int) *PathsCollection

func NewPathsUsing

func NewPathsUsing(
	directoryPath, separator string,
	isNormalize bool,
) *PathsCollection

func NewPathsUsingPaths

func NewPathsUsingPaths(
	rootPath, separator string,
	recursivePaths *[]string,
) *PathsCollection

func NewPathsUsingWrappers

func NewPathsUsingWrappers(
	rootPath, separator string,
	wrappers *Wrappers,
) *PathsCollection

func (*PathsCollection) Add

func (pathsCollection *PathsCollection) Add(
	wrapper *SimplePathWrapper,
) *PathsCollection

func (*PathsCollection) AddPtr

func (pathsCollection *PathsCollection) AddPtr(
	wrapper *SimplePathWrapper,
) *PathsCollection

func (*PathsCollection) AddWrapper

func (pathsCollection *PathsCollection) AddWrapper(
	pathWrapper *SimplePathWrapper,
) *PathsCollection

func (*PathsCollection) AllRecursiveDirs added in v0.0.6

func (pathsCollection *PathsCollection) AllRecursiveDirs() *errstr.ResultsWithErrorCollection

func (*PathsCollection) AllRecursiveFiles added in v0.0.6

func (pathsCollection *PathsCollection) AllRecursiveFiles() *errstr.ResultsWithErrorCollection

func (*PathsCollection) AllRecursivePaths added in v0.0.6

func (pathsCollection *PathsCollection) AllRecursivePaths() *errstr.ResultsWithErrorCollection

func (*PathsCollection) AsJsonParseSelfInjector added in v0.0.7

func (pathsCollection *PathsCollection) AsJsonParseSelfInjector() corejson.JsonParseSelfInjector

func (*PathsCollection) AsJsoner added in v0.0.7

func (pathsCollection *PathsCollection) AsJsoner() corejson.Jsoner

func (*PathsCollection) Directories

func (pathsCollection *PathsCollection) Directories() *[]string

func (*PathsCollection) Files

func (pathsCollection *PathsCollection) Files() *[]string

func (*PathsCollection) HasParentWrappers

func (pathsCollection *PathsCollection) HasParentWrappers() bool

func (*PathsCollection) IsContains

func (pathsCollection *PathsCollection) IsContains(
	path string,
	isCaseSensitive bool,
) bool

func (*PathsCollection) IsEmpty

func (pathsCollection *PathsCollection) IsEmpty() bool

func (*PathsCollection) IsParentWrappersEmpty

func (pathsCollection *PathsCollection) IsParentWrappersEmpty() bool

func (*PathsCollection) Json added in v0.0.7

func (pathsCollection *PathsCollection) Json() *corejson.Result

func (*PathsCollection) JsonModel added in v0.0.7

func (pathsCollection *PathsCollection) JsonModel() *PathsCollectionDataModel

func (*PathsCollection) JsonModelAny added in v0.0.7

func (pathsCollection *PathsCollection) JsonModelAny() interface{}

func (*PathsCollection) JsonParseSelfInject added in v0.0.7

func (pathsCollection *PathsCollection) JsonParseSelfInject(
	jsonResult *corejson.Result,
) error

func (*PathsCollection) Length

func (pathsCollection *PathsCollection) Length() int

func (*PathsCollection) MarshalJSON added in v0.0.7

func (pathsCollection *PathsCollection) MarshalJSON() ([]byte, error)

func (*PathsCollection) ParentWrappers

func (pathsCollection *PathsCollection) ParentWrappers() *Wrappers

func (*PathsCollection) ParseInjectUsingJson added in v0.0.7

func (pathsCollection *PathsCollection) ParseInjectUsingJson(
	jsonResult *corejson.Result,
) (*PathsCollection, error)

func (*PathsCollection) ParseInjectUsingJsonMust added in v0.0.7

func (pathsCollection *PathsCollection) ParseInjectUsingJsonMust(
	jsonResult *corejson.Result,
) *PathsCollection

Panic if error

func (*PathsCollection) String added in v0.0.7

func (pathsCollection *PathsCollection) String() string

func (*PathsCollection) Strings added in v0.0.7

func (pathsCollection *PathsCollection) Strings() *[]string

func (*PathsCollection) UnmarshalJSON added in v0.0.7

func (pathsCollection *PathsCollection) UnmarshalJSON(data []byte) error

type PathsCollectionDataModel added in v0.0.7

type PathsCollectionDataModel struct {
	RootPath       string
	PathWrappers   *[]*SimplePathWrapper `json:"SimplePathWrappers"`
	Separator      string
	ErrorWrapper   *errorwrapper.Wrapper
	ParentWrappers *Wrappers
}

type SimplePathWrapper added in v0.0.6

type SimplePathWrapper struct {
	Path        string
	IsDirectory bool
}

func (*SimplePathWrapper) BaseDir added in v0.0.7

func (simplePathWrapper *SimplePathWrapper) BaseDir() string

func (*SimplePathWrapper) GetBothExtension added in v0.0.7

func (simplePathWrapper *SimplePathWrapper) GetBothExtension() (dotExt, ext string)

func (*SimplePathWrapper) GetFileNameOnly added in v0.0.7

func (simplePathWrapper *SimplePathWrapper) GetFileNameOnly() (fileNameWithoutExt string)

func (*SimplePathWrapper) GetFileNamePlusExt added in v0.0.7

func (simplePathWrapper *SimplePathWrapper) GetFileNamePlusExt() (filename, ext string)

func (*SimplePathWrapper) IsEquals added in v0.0.6

func (simplePathWrapper *SimplePathWrapper) IsEquals(anotherWrapper SimplePathWrapper) bool

func (*SimplePathWrapper) IsEqualsPtr added in v0.0.6

func (simplePathWrapper *SimplePathWrapper) IsEqualsPtr(anotherWrapper *SimplePathWrapper) bool

func (*SimplePathWrapper) String added in v0.0.6

func (simplePathWrapper *SimplePathWrapper) String() string

type Wrapper

type Wrapper struct {
	FileInfo     *os.FileInfo
	ErrorWrapper *errorwrapper.Wrapper
	RawPath      string
	IsDirectory  bool
	IsFile       bool
	IsEmptyPath  bool

	Separator string
	// contains filtered or unexported fields
}

func New

func New(rawPath, separator string) *Wrapper

func NewError

func NewError(
	filePath, separator string,
	err error,
) *Wrapper

func NewUsingInfo

func NewUsingInfo(
	osFileInfo os.FileInfo,
	filePath, separator string,
	err error,
) *Wrapper

func (*Wrapper) AllSplits added in v0.0.7

func (wrapper *Wrapper) AllSplits() *[]string

func (*Wrapper) AsJsonParseSelfInjector added in v0.0.7

func (wrapper *Wrapper) AsJsonParseSelfInjector() corejson.JsonParseSelfInjector

func (*Wrapper) AsJsoner added in v0.0.7

func (wrapper *Wrapper) AsJsoner() corejson.Jsoner

func (*Wrapper) BaseDir added in v0.0.7

func (wrapper *Wrapper) BaseDir() string

func (*Wrapper) FileName added in v0.0.7

func (wrapper *Wrapper) FileName() (filename string)

func (*Wrapper) FileNameWithoutExt added in v0.0.7

func (wrapper *Wrapper) FileNameWithoutExt() (filename string)

func (*Wrapper) GetBothExtensions added in v0.0.7

func (wrapper *Wrapper) GetBothExtensions() (dotExt, ext string)

func (*Wrapper) HasError

func (wrapper *Wrapper) HasError() bool

func (*Wrapper) IsPathExists

func (wrapper *Wrapper) IsPathExists() bool

func (*Wrapper) Json added in v0.0.7

func (wrapper *Wrapper) Json() *corejson.Result

func (*Wrapper) JsonModel added in v0.0.7

func (wrapper *Wrapper) JsonModel() *WrapperDataModel

func (*Wrapper) JsonModelAny added in v0.0.7

func (wrapper *Wrapper) JsonModelAny() interface{}

func (*Wrapper) JsonParseSelfInject added in v0.0.7

func (wrapper *Wrapper) JsonParseSelfInject(
	jsonResult *corejson.Result,
) error

func (*Wrapper) MarshalJSON added in v0.0.7

func (wrapper *Wrapper) MarshalJSON() ([]byte, error)

func (*Wrapper) ModifyTime added in v0.0.7

func (wrapper *Wrapper) ModifyTime() time.Time

func (*Wrapper) Parent added in v0.0.7

func (wrapper *Wrapper) Parent() *Wrapper

func (*Wrapper) ParseInjectUsingJson added in v0.0.7

func (wrapper *Wrapper) ParseInjectUsingJson(
	jsonResult *corejson.Result,
) (*Wrapper, error)

func (*Wrapper) ParseInjectUsingJsonMust added in v0.0.7

func (wrapper *Wrapper) ParseInjectUsingJsonMust(
	jsonResult *corejson.Result,
) *Wrapper

Panic if error

func (*Wrapper) Size added in v0.0.7

func (wrapper *Wrapper) Size() int64

func (*Wrapper) String added in v0.0.7

func (wrapper *Wrapper) String() string

func (*Wrapper) ToString added in v0.0.7

func (wrapper *Wrapper) ToString(sep string) string

func (*Wrapper) UnmarshalJSON added in v0.0.7

func (wrapper *Wrapper) UnmarshalJSON(data []byte) error

type WrapperDataModel added in v0.0.7

type WrapperDataModel struct {
	RawPath     string
	IsDirectory bool
	IsFile      bool
	IsEmptyPath bool
	Separator   string
}

type Wrappers

type Wrappers struct {
	RootPath  string
	Separator string
	Items     *[]*Wrapper

	ErrorWrapper *errorwrapper.Wrapper
	// contains filtered or unexported fields
}

func EmptyWrappers

func EmptyWrappers() *Wrappers

func GetDirectoriesWrappers

func GetDirectoriesWrappers(rootPath string, wrapperIn *[]*Wrapper) *Wrappers

func GetFilesWrappers

func GetFilesWrappers(rootPath string, wrapperIn *[]*Wrapper) *Wrappers

func NewWrappersPtr

func NewWrappersPtr(
	filePath, separator string,
	isNormalize bool,
) *Wrappers

func NewWrappersPtrUsingCapacity

func NewWrappersPtrUsingCapacity(rootPath string, capacity int) *Wrappers

func (*Wrappers) AsJsonParseSelfInjector added in v0.0.7

func (wrappers *Wrappers) AsJsonParseSelfInjector() corejson.JsonParseSelfInjector

func (*Wrappers) AsJsoner added in v0.0.7

func (wrappers *Wrappers) AsJsoner() corejson.Jsoner

func (*Wrappers) FileNamesCollection

func (wrappers *Wrappers) FileNamesCollection() *FileNamesCollection

func (*Wrappers) HasAny

func (wrappers *Wrappers) HasAny() bool

func (*Wrappers) IsEmpty

func (wrappers *Wrappers) IsEmpty() bool

func (*Wrappers) IsNameContains

func (wrappers *Wrappers) IsNameContains(
	name string,
	isCaseSensitive bool,
) bool

func (*Wrappers) IsPathContains

func (wrappers *Wrappers) IsPathContains(
	path string,
	isCaseSensitive bool,
) bool

func (*Wrappers) Json added in v0.0.7

func (wrappers *Wrappers) Json() *corejson.Result

func (*Wrappers) JsonModel added in v0.0.7

func (wrappers *Wrappers) JsonModel() *Wrappers

func (*Wrappers) JsonModelAny added in v0.0.7

func (wrappers *Wrappers) JsonModelAny() interface{}

func (*Wrappers) JsonParseSelfInject added in v0.0.7

func (wrappers *Wrappers) JsonParseSelfInject(
	jsonResult *corejson.Result,
) error

func (*Wrappers) Length

func (wrappers *Wrappers) Length() int

func (*Wrappers) ParseInjectUsingJson added in v0.0.7

func (wrappers *Wrappers) ParseInjectUsingJson(
	jsonResult *corejson.Result,
) (*Wrappers, error)

func (*Wrappers) ParseInjectUsingJsonMust added in v0.0.7

func (wrappers *Wrappers) ParseInjectUsingJsonMust(
	jsonResult *corejson.Result,
) *Wrappers

Panic if error

func (*Wrappers) PathsCollection

func (wrappers *Wrappers) PathsCollection() *PathsCollection

func (*Wrappers) RecursiveDirs added in v0.0.6

func (wrappers *Wrappers) RecursiveDirs() *PathsCollection

func (*Wrappers) RecursivePathsFilter

func (wrappers *Wrappers) RecursivePathsFilter(
	filter pathfuncs.Filter,
) *PathsCollection

func (*Wrappers) RootDirs

func (wrappers *Wrappers) RootDirs() *Wrappers

func (*Wrappers) RootFiles

func (wrappers *Wrappers) RootFiles() *Wrappers

Jump to

Keyboard shortcuts

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