fileinfo

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2022 License: MIT Imports: 20 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 (it *FileNamesCollection) Add(fileName string) *FileNamesCollection

func (*FileNamesCollection) AddWrapper

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

func (*FileNamesCollection) GetFilePaths

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

GetFilePaths

Root level files paths, no nested paths.

func (*FileNamesCollection) HasIssuesOrEmpty added in v0.5.2

func (it *FileNamesCollection) HasIssuesOrEmpty() bool

func (*FileNamesCollection) HasParentWrappers

func (it *FileNamesCollection) HasParentWrappers() bool

func (*FileNamesCollection) IsContains

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

func (*FileNamesCollection) IsEmpty

func (it *FileNamesCollection) IsEmpty() bool

func (*FileNamesCollection) IsParentWrappersEmpty

func (it *FileNamesCollection) IsParentWrappersEmpty() bool

func (*FileNamesCollection) Length

func (it *FileNamesCollection) Length() int

func (*FileNamesCollection) OnlyNamesCollection

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

func (*FileNamesCollection) ParentWrappers

func (it *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 (it *PathsCollection) Add(
	wrapper *SimplePathWrapper,
) *PathsCollection

func (*PathsCollection) AddPtr

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

func (*PathsCollection) AddWrapper

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

func (*PathsCollection) AsJsonContractsBinder added in v0.5.3

func (it *PathsCollection) AsJsonContractsBinder() corejson.JsonContractsBinder

func (*PathsCollection) AsJsonParseSelfInjector added in v0.0.7

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

func (*PathsCollection) AsJsoner added in v0.0.7

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

func (*PathsCollection) Directories

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

func (*PathsCollection) Files

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

func (*PathsCollection) HasParentWrappers

func (it *PathsCollection) HasParentWrappers() bool

func (*PathsCollection) IsEmpty

func (it *PathsCollection) IsEmpty() bool

func (*PathsCollection) IsParentWrappersEmpty

func (it *PathsCollection) IsParentWrappersEmpty() bool

func (PathsCollection) Json added in v0.0.7

func (it PathsCollection) Json() corejson.Result

func (*PathsCollection) JsonModel added in v0.0.7

func (it *PathsCollection) JsonModel() *PathsCollectionDataModel

func (*PathsCollection) JsonModelAny added in v0.0.7

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

func (*PathsCollection) JsonParseSelfInject added in v0.0.7

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

func (PathsCollection) JsonPtr added in v0.5.2

func (it PathsCollection) JsonPtr() *corejson.Result

func (*PathsCollection) Length

func (it *PathsCollection) Length() int

func (*PathsCollection) MarshalJSON added in v0.0.7

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

func (*PathsCollection) ParentWrappers

func (it *PathsCollection) ParentWrappers() *Wrappers

func (*PathsCollection) ParseInjectUsingJson added in v0.0.7

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

func (*PathsCollection) ParseInjectUsingJsonMust added in v0.0.7

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

Panic if error

func (PathsCollection) String added in v0.0.7

func (it PathsCollection) String() string

func (*PathsCollection) Strings added in v0.0.7

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

func (*PathsCollection) UnmarshalJSON added in v0.0.7

func (it *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 (it *SimplePathWrapper) BaseDir() string

func (*SimplePathWrapper) GetBothExtension added in v0.0.7

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

func (*SimplePathWrapper) GetFileNameOnly added in v0.0.7

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

func (*SimplePathWrapper) GetFileNamePlusExt added in v0.0.7

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

func (*SimplePathWrapper) IsEquals added in v0.0.6

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

func (*SimplePathWrapper) IsEqualsPtr added in v0.0.6

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

func (SimplePathWrapper) String added in v0.0.6

func (it 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 (it *Wrapper) AllSplits() *[]string

func (*Wrapper) AsJsonContractsBinder added in v0.5.3

func (it *Wrapper) AsJsonContractsBinder() corejson.JsonContractsBinder

func (*Wrapper) AsJsonParseSelfInjector added in v0.0.7

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

func (*Wrapper) AsJsoner added in v0.0.7

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

func (*Wrapper) BaseDir added in v0.0.7

func (it *Wrapper) BaseDir() string

func (*Wrapper) FileName added in v0.0.7

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

func (*Wrapper) FileNameWithoutExt added in v0.0.7

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

func (*Wrapper) GetBothExtensions added in v0.0.7

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

func (*Wrapper) HasError

func (it *Wrapper) HasError() bool

func (*Wrapper) IsPathExists

func (it *Wrapper) IsPathExists() bool

func (Wrapper) Json added in v0.0.7

func (it Wrapper) Json() corejson.Result

func (*Wrapper) JsonModel added in v0.0.7

func (it *Wrapper) JsonModel() *WrapperDataModel

func (*Wrapper) JsonModelAny added in v0.0.7

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

func (*Wrapper) JsonParseSelfInject added in v0.0.7

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

func (Wrapper) JsonPtr added in v0.5.2

func (it Wrapper) JsonPtr() *corejson.Result

func (*Wrapper) MarshalJSON added in v0.0.7

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

func (*Wrapper) ModifyTime added in v0.0.7

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

func (*Wrapper) Parent added in v0.0.7

func (it *Wrapper) Parent() *Wrapper

func (*Wrapper) ParseInjectUsingJson added in v0.0.7

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

func (*Wrapper) ParseInjectUsingJsonMust added in v0.0.7

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

Panic if error

func (*Wrapper) Size added in v0.0.7

func (it *Wrapper) Size() int64

func (Wrapper) String added in v0.0.7

func (it Wrapper) String() string

func (*Wrapper) ToString added in v0.0.7

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

func (*Wrapper) UnmarshalJSON added in v0.0.7

func (it *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, wrappersIn []*Wrapper) *Wrappers

func NewWrappersPtr

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

func NewWrappersPtrUsingCapacity

func NewWrappersPtrUsingCapacity(rootPath string, capacity int) *Wrappers

func (*Wrappers) AsJsonContractsBinder added in v0.5.3

func (it *Wrappers) AsJsonContractsBinder() corejson.JsonContractsBinder

func (*Wrappers) AsJsonParseSelfInjector added in v0.0.7

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

func (*Wrappers) AsJsoner added in v0.0.7

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

func (*Wrappers) FileNamesCollection

func (it *Wrappers) FileNamesCollection() *FileNamesCollection

func (*Wrappers) HasAny

func (it *Wrappers) HasAny() bool

func (*Wrappers) IsEmpty

func (it *Wrappers) IsEmpty() bool

func (*Wrappers) IsNameContains

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

func (Wrappers) Json added in v0.0.7

func (it Wrappers) Json() corejson.Result

func (*Wrappers) JsonModel added in v0.0.7

func (it *Wrappers) JsonModel() *Wrappers

func (*Wrappers) JsonModelAny added in v0.0.7

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

func (*Wrappers) JsonParseSelfInject added in v0.0.7

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

func (Wrappers) JsonPtr added in v0.5.2

func (it Wrappers) JsonPtr() *corejson.Result

func (*Wrappers) Length

func (it *Wrappers) Length() int

func (*Wrappers) ParseInjectUsingJson added in v0.0.7

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

func (*Wrappers) ParseInjectUsingJsonMust added in v0.0.7

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

ParseInjectUsingJsonMust Panic if error

func (*Wrappers) PathsCollection

func (it *Wrappers) PathsCollection() *PathsCollection

func (*Wrappers) RootDirs

func (it *Wrappers) RootDirs() *Wrappers

func (*Wrappers) RootFiles

func (it *Wrappers) RootFiles() *Wrappers

Jump to

Keyboard shortcuts

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