-
Notifications
You must be signed in to change notification settings - Fork 1
/
type.go
86 lines (71 loc) · 2.01 KB
/
type.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// -----------------------------------------------------------------------------
// CMDX Utilities Suite cmdx/[type.go]
// (c) [email protected] License: GPLv3
// -----------------------------------------------------------------------------
package main
import (
"time"
"github.com/balacode/zr"
)
// -----------------------------------------------------------------------------
// # Types
// BuildIssue stores the message and location of each build issue/error
type BuildIssue struct {
File string // file name (may be with or without a path)
Line int // line number
Col int // column number
Msg string // message (usually a build error message)
}
// FilesMap groups files by their file sizes.
// (If two files have different sizes, they're definitely
// different, so there's no need to open and compare them.)
type FilesMap map[int64][]*PathAndSize
// FindReplLinesBatch holds groups of searches
// and corresponding replacements.
type FindReplLinesBatch struct {
FindLines []Lines
ReplLines []Lines
}
// FindReplLines _ _
type FindReplLines struct {
Path string
Exts []string
FindLines []string
ReplLines []string
CaseMode zr.CaseMode
}
// FindReplLinesTree _ _
type FindReplLinesTree struct {
FindLines Lines // what to find
ReplLines Lines // what to replace with
Sub map[string]*FindReplLinesTree // a 'branch' of the tree
}
// Lines _ _
type Lines []string
// PathAndSize stores a fully-qualified file name and the file's size.
type PathAndSize struct {
Path string
Size int64
}
// ReplCmd _ _
type ReplCmd struct {
Path string
Exts []string
Mark string
Items []ReplItem
}
// ReplItem _ _
type ReplItem struct {
Find string
Repl string
CaseMode zr.CaseMode
WordMode zr.WordMode
}
// TextFile holds file details and content of a text file.
type TextFile struct {
Path string
ModTime time.Time
Size int64
Lines []string
}
// end