Path: blob/main/vendor/github.com/spf13/afero/mem/dir.go
2880 views
// Copyright © 2014 Steve Francia <[email protected]>.1//2// Licensed under the Apache License, Version 2.0 (the "License");3// you may not use this file except in compliance with the License.4// You may obtain a copy of the License at5// http://www.apache.org/licenses/LICENSE-2.06//7// Unless required by applicable law or agreed to in writing, software8// distributed under the License is distributed on an "AS IS" BASIS,9// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.10// See the License for the specific language governing permissions and11// limitations under the License.1213package mem1415type Dir interface {16Len() int17Names() []string18Files() []*FileData19Add(*FileData)20Remove(*FileData)21}2223func RemoveFromMemDir(dir *FileData, f *FileData) {24dir.memDir.Remove(f)25}2627func AddToMemDir(dir *FileData, f *FileData) {28dir.memDir.Add(f)29}3031func InitializeDir(d *FileData) {32if d.memDir == nil {33d.dir = true34d.memDir = &DirMap{}35}36}373839