-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfuncs.go
More file actions
728 lines (597 loc) · 18.6 KB
/
Copy pathfuncs.go
File metadata and controls
728 lines (597 loc) · 18.6 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
package main
// imports <<<
import (
"os"
"io/fs"
"fmt"
"sort"
"time"
"path"
"path/filepath"
"regexp"
"strings"
"strconv"
"github.com/codingsince1985/checksum"
"github.com/charmbracelet/lipgloss"
"golang.org/x/term"
"diffee/tree"
) // >>>
// Enums <<<
type SizeDiffState int
const (
SameSize SizeDiffState = iota
Bigger
Smaller
)
type TimeDiffState int
const (
SameTime TimeDiffState = iota
Newer
Older
)
// >>>
// Entry struct <<<
type Entry struct {
// same for left and right
NormPath string
Name string
IsDir bool
IsDotfile bool
IsDiff bool
// different for left and right
Path map[string]string
Size map[string]int64
ModTime map[string]time.Time
Checksum map[string]string
IsMissing map[string]bool
IsOrphan map[string]bool
SizeDiff map[string]SizeDiffState
TimeDiff map[string]TimeDiffState
}
func (self Entry) String() string {
return fmt.Sprintf("%s", self.Name)
}
// >>>
// Variables <<<
var (
NameRegEx *regexp.Regexp = regexp.MustCompile("[^/]+/?$")
StyleRoot = lipgloss.NewStyle().Foreground(lipgloss.Color("11"))
StyleMissing = lipgloss.NewStyle().Foreground(lipgloss.Color("4"))
StyleOrphan = lipgloss.NewStyle().Foreground(lipgloss.Color("12"))
StyleBigger = lipgloss.NewStyle().Foreground(lipgloss.Color("10"))
StyleSmaller = lipgloss.NewStyle().Foreground(lipgloss.Color("9"))
StyleNewer = lipgloss.NewStyle().Foreground(lipgloss.Color("10"))
StyleOlder = lipgloss.NewStyle().Foreground(lipgloss.Color("9"))
StyleDiff = lipgloss.NewStyle().Foreground(lipgloss.Color("13"))
SizeStyles = map[SizeDiffState]lipgloss.Style{
SameSize: lipgloss.NewStyle(),
Bigger: StyleBigger,
Smaller: StyleSmaller,
}
TimeStyles = map[TimeDiffState]lipgloss.Style{
SameTime: lipgloss.NewStyle(),
Newer: StyleNewer,
Older: StyleOlder,
}
RightSideOffset int = 10
)
// >>>
func printError(msg string) {// <<<
fmt.Fprintln(os.Stderr, "diffee error: " + msg)
}// >>>
func setNoColor() {// <<<
StyleRoot = lipgloss.NewStyle()
StyleMissing = lipgloss.NewStyle()
StyleOrphan = lipgloss.NewStyle()
StyleBigger = lipgloss.NewStyle()
StyleSmaller = lipgloss.NewStyle()
StyleNewer = lipgloss.NewStyle()
StyleOlder = lipgloss.NewStyle()
StyleDiff = lipgloss.NewStyle()
}// >>>
func isDir(dirpath string) bool {// <<<
return dirpath[len(dirpath)-1:] == "/"
}// >>>
func isDirectory(dirpath string) bool {// <<<
fileInfo, err := os.Stat(dirpath)
if err != nil {
return false
}
return fileInfo.IsDir()
}// >>>
func getUnionSetOfDirContents(left string, right string, ListOfPaths *[]string) {// <<<
var Root string
var SetOfPaths = make(map[string]struct{})
WalkerFunc := func(fpath string, info fs.FileInfo, err error) error {
if err != nil {
return err
}
if fpath == Root {
SetOfPaths["."] = struct{}{}
return nil
}
fpath = path.Clean(strings.Replace(fpath, Root, "", 1))
if Arg_Depth != 0 {
if strings.Count(fpath, string(os.PathSeparator)) >= Arg_Depth {
return filepath.SkipDir
}
}
if Arg_All == false {
NameChunk := NameRegEx.FindString(fpath)
if NameChunk[:1] == "." {
if info.IsDir() {
return filepath.SkipDir
} else {
return nil
}
}
}
if info.IsDir() {
fpath = fpath + "/"
}
if len(Arg_Include) > 0 {
MatchFound := false
for in:=0 ; in < len(Arg_Include) ; in++ {
Match := Arg_Include[in].FindString(fpath)
if Match != "" {
MatchFound = true
}
}
if MatchFound == false {
return nil
}
}
if len(Arg_Exclude) > 0 {
for ex:=0 ; ex < len(Arg_Exclude) ; ex++ {
Match := Arg_Exclude[ex].FindString(fpath)
if Match != "" {
if info.IsDir() {
return filepath.SkipDir
} else {
return nil
}
}
}
}
if Arg_Files {
if info.IsDir() {
return nil
}
}
if Arg_Folders {
if info.IsDir() == false {
return nil
}
}
if Arg_Files || (len(Arg_Include) > 0) {
SplitPath := strings.SplitAfter(fpath, "/")
CombinedPath := ""
for i:=0; i < len(SplitPath); i++ {
CombinedPath = CombinedPath + SplitPath[i]
SetOfPaths[CombinedPath] = struct{}{}
}
return nil
}
SetOfPaths[fpath] = struct{}{}
return nil
}
Root = left
err := filepath.Walk(left, WalkerFunc)
if err != nil {
fmt.Println(err)
}
Root = right
err = filepath.Walk(right, WalkerFunc)
if err != nil {
fmt.Println(err)
}
for p := range SetOfPaths {
*ListOfPaths = append(*ListOfPaths, p)
}
sort.Strings(*ListOfPaths)
}// >>>
func getDirContentInformation(leftroot string, rightroot string, unionset *[]string, content *[]Entry) {// <<<
*content = append(*content, Entry{ Path: map[string]string{ "left": leftroot, "right": rightroot } } )
for i:=1 ; i < len(*unionset) ; i++ {
LeftPath := leftroot + (*unionset)[i]
RightPath := rightroot + (*unionset)[i]
NormPath := (*unionset)[i]
IsDotfile := false
Name := NameRegEx.FindString(NormPath)
if Name[:1] == "." {
IsDotfile = true
}
LeftFileInfo , LErr := os.Stat(LeftPath)
RightFileInfo, RErr := os.Stat(RightPath)
var IsDir bool = isDir(Name)
var LeftSize int64 = 0
var LeftModTime time.Time = time.Time{}
var LeftChecksum string = ""
var LeftIsOrphan bool = false
var LeftIsMissing bool = false
var LeftSizeState SizeDiffState = SameSize
var LeftTimeState TimeDiffState = SameTime
var RightSize int64 = 0
var RightModTime time.Time = time.Time{}
var RightChecksum string = ""
var RightIsOrphan bool = false
var RightIsMissing bool = false
var RightSizeState SizeDiffState = SameSize
var RightTimeState TimeDiffState = SameTime
if LErr != nil {
LeftIsMissing = true
} else if IsDir != LeftFileInfo.IsDir() {
LeftIsMissing = true
} else {
// println(LeftPath, NormPath, Name, LeftFileInfo.Name())
if IsDir == false {
LeftSize = LeftFileInfo.Size()
LeftModTime = LeftFileInfo.ModTime()
LeftChecksum,_ = checksum.CRC32(LeftPath)
}
}
if RErr != nil {
RightIsMissing = true
} else if IsDir != RightFileInfo.IsDir() {
RightIsMissing = true
} else {
// println(RightPath, NormPath, Name, RightFileInfo.Name())
if IsDir == false {
RightSize = RightFileInfo.Size()
RightModTime = RightFileInfo.ModTime()
RightChecksum,_ = checksum.CRC32(RightPath)
}
}
if LeftIsMissing {
RightIsOrphan = true
} else {
if IsDir == false {
if LeftSize > RightSize {
LeftSizeState = Bigger
} else if LeftSize < RightSize {
LeftSizeState = Smaller
}
if LeftModTime.After(RightModTime) {
LeftTimeState = Newer
} else if LeftModTime.Before(RightModTime) {
LeftTimeState = Older
}
}
}
if RightIsMissing {
LeftIsOrphan = true
} else {
if IsDir == false {
if RightSize > LeftSize {
RightSizeState = Bigger
} else if RightSize < LeftSize {
RightSizeState = Smaller
}
if RightModTime.After(LeftModTime) {
RightTimeState = Newer
} else if RightModTime.Before(LeftModTime) {
RightTimeState = Older
}
}
}
NewEntry := Entry {
NormPath : NormPath,
Name : Name,
IsDir : IsDir,
IsDotfile : IsDotfile,
IsDiff : (LeftChecksum != RightChecksum),
Path : map[string]string { "left": LeftPath , "right": RightPath },
Size : map[string]int64 { "left": LeftSize , "right": RightSize },
ModTime : map[string]time.Time { "left": LeftModTime , "right": RightModTime },
Checksum : map[string]string { "left": LeftChecksum , "right": RightChecksum },
IsMissing: map[string]bool { "left": LeftIsMissing, "right": RightIsMissing },
IsOrphan : map[string]bool { "left": LeftIsOrphan , "right": RightIsOrphan },
SizeDiff : map[string]SizeDiffState { "left": LeftSizeState, "right": RightSizeState },
TimeDiff : map[string]TimeDiffState { "left": LeftTimeState, "right": RightTimeState }}
*content = append(*content, NewEntry)
}
}// >>>
func decorateText(entry *Entry, side string) string {// <<<
if (*entry).IsMissing[side] {
return StyleMissing.Render(strings.Repeat("░", len((*entry).Name)))
}
var Style lipgloss.Style = lipgloss.NewStyle()
var Info string = ""
if (*entry).IsOrphan[side] {
Style = StyleOrphan
} else {
if Arg_Size {
State := (*entry).SizeDiff[side]
Style = SizeStyles[State]
if Arg_Info && State != SameSize {
Info = " (" + strconv.FormatInt(int64((*entry).Size[side]), 10) + " bytes)"
}
} else if Arg_Time {
State := (*entry).TimeDiff[side]
Style = TimeStyles[State]
if Arg_Info && State != SameTime {
Info = " (" + (*entry).ModTime[side].Format(time.RFC3339) + ")"
}
} else if Arg_CRC32 {
if (*entry).IsDiff {
Style = StyleDiff
if Arg_Info {
Info = " (" + (*entry).Checksum[side] + ")"
}
}
}
}
return Style.Render((*entry).Name) + Info
}// >>>
func convertSliceToTree(content *[]Entry, side string) *tree.Tree { // <<<
// var Result = tree.NewTree(StyleRoot.Render((*content)[0].Path[side]))
var Result = tree.NewTree((*content)[0].Path[side])
var Stack []*tree.Node
var LastDepth int = 0
var CurrentDepth int = 0
Stack = append(Stack, &(Result.Node))
for i := 1; i < len(*content); i++ {
E := (*content)[i]
CurrentDepth = strings.Count(E.NormPath, "/") // count slashes
if E.IsDir {
CurrentDepth = CurrentDepth - 1
}
if CurrentDepth > LastDepth { // push new child onto stack
Stack = append(Stack, Stack[LastDepth].GetChild(-1))
LastDepth = CurrentDepth
} else if CurrentDepth < LastDepth { // // pop from stack as many as we go directories upwards
Stack = Stack[:len(Stack)-(LastDepth-CurrentDepth)]
LastDepth = CurrentDepth
}
Stack[LastDepth].AddChild(&E).SetText(decorateText(&E, side))
}
return Result
}// >>>
func filterTrees(leftNode *tree.Node, rightNode *tree.Node) {// <<<
// THIS FUNCTION WAS GENERATED USING AI BASED ON A PREVIOUS FUNCTION.
// THE CODE SEEMS TO MAKE SENSE AND SEEMS TO WORK.
// filterTrees recursively filters *both* trees simultaneously to keep them aligned.
// It works "bottom-up" (post-order traversal).
// --- 1. Recurse First (Bottom-Up) ---
// We assume the trees have an identical structure, as they were built
// from the same slice. We must iterate them together.
if len(leftNode.GetChildren()) != len(rightNode.GetChildren()) {
// This should never happen if build logic is correct, but it's a safe check.
return
}
for i := 0; i < len(leftNode.GetChildren()); i++ {
// GetChild() is 1-based, so we use i+1
filterTrees(leftNode.GetChild(i+1), rightNode.GetChild(i+1))
}
// --- 2. Get Data & Handle Root ---
// Root nodes (the paths) are never hidden.
if leftNode.GetParent() == nil {
return
}
// Both nodes point to the *same* Entry struct,
// so we only need to get the data from one.
data, ok := leftNode.GetData().(*Entry)
if !ok {
// This shouldn't happen, but it's safe to skip if it does.
return
}
E := data // E for Entry
var shouldHide bool = false // A single decision for both nodes
// --- 3. Universal Filters (Orphans) ---
// This logic is unchanged, as it's already based on the combined Entry.
if Arg_Orphans && (!E.IsOrphan["left"] && !E.IsOrphan["right"]) {
shouldHide = true
} else if Arg_NoOrphans && (E.IsOrphan["left"] || E.IsOrphan["right"]) {
shouldHide = true
} else if Arg_LeftOrphans && !E.IsOrphan["left"] {
// "Show only left orphans" -> hide if NOT a left orphan
shouldHide = true
} else if Arg_RightOrphans && !E.IsOrphan["right"] {
// "Show only right orphans" -> hide if NOT a right orphan
shouldHide = true
}
if Arg_LeftYounger && !(E.TimeDiff["left"] == Newer) {
shouldHide = true
} else if Arg_RightYounger && !(E.TimeDiff["right"] == Newer) {
shouldHide = true
}
if Arg_LeftBigger && !(E.SizeDiff["left"] == Bigger) {
shouldHide = true
} else if Arg_RightBigger && !(E.SizeDiff["right"] == Bigger) {
shouldHide = true
}
// --- 4. Type-Specific Filters ---
if E.IsDir {
// --- Directory-specific filters ---
if Arg_Files { // Hide all folders if -files is set
shouldHide = true
}
// --- Hide Empty Dirs ---
// A directory is only hidden if it's considered empty on *both* sides.
// Since child nodes are already filtered, CountChildren(true) is accurate.
if !shouldHide && Arg_NoEmpty {
if leftNode.CountChildren(true) == 0 && rightNode.CountChildren(true) == 0 {
shouldHide = true
}
}
} else {
// --- File-specific filters ---
if Arg_Folders { // Hide all files if -folders is set
shouldHide = true
}
// Only check diff/same if the file isn't already hidden
if !shouldHide {
// 1. Determine the "isSame" status based on the active comparison mode
var isSame bool = false // Default to "different"
if Arg_Size {
// It's "same" if BOTH sides show SameSize.
// (Note: For orphans, one side won't be SameSize, so this is safe)
isSame = (E.SizeDiff["left"] == SameSize && E.SizeDiff["right"] == SameSize)
} else if Arg_Time {
// It's "same" if BOTH sides show SameTime.
isSame = (E.TimeDiff["left"] == SameTime && E.TimeDiff["right"] == SameTime)
} else {
// Default to CRC32 comparison (or if no mode is selected)
// You can just use E.IsDiff here.
isSame = !E.IsDiff
}
// 2. Apply the filter logic
if Arg_Diff && isSame {
// "Show only diff" -> hide if same
shouldHide = true
} else if Arg_Same && !isSame {
// "Show only same" -> hide if diff
shouldHide = true
}
}
}
// --- 5. Apply the Filter (Synchronized) ---
// Apply the *same* decision to both nodes.
leftNode.HideNode(shouldHide)
rightNode.HideNode(shouldHide)
}// >>>
// func resetTreeVisibility(node *tree.Node) {<<<
// node.HideNode(false)
// for _, child := range node.GetChildren() {
// resetTreeVisibility(child)
// }
// }>>>
func shortenPath(left_path string, right_path string, max_width int) (string, string) {// <<<
// for now it's just a super dumb version that cuts of from the front until it fits into max_width
// I can later think a about a more sophisticated algorithm
// Separator := string(os.PathSeparator)
// /some/ass/long/path/a/ -> …/a/
// /some/ass/long/path/b/ -> …/b/
// /some/ass/long/a/path/ -> …/a/…
// /some/ass/long/b/path/ -> …/b/…
// /a/some/ass/long/path/ -> /a/…
// /b/some/ass/long/path/ -> /b/…
// /some/ass/long/path/ -> …/long/…
// /some/ass/super/long/path/ -> …/super/…
// /some/ass/long/path/ -> …/path/
// /some/ass/long/path/ab/cd/ -> …/cd/
// AbsLeftPath, Err := filepath.Abs(left_path)
// if Err != nil {
// printError(fmt.Sprintf("could not get absolute path for '%s'", left_path))
// }
//
// AbsRightPath, Err := filepath.Abs(right_path)
// if Err != nil {
// printError(fmt.Sprintf("could not get absolute path for '%s'", right_path))
// }
//
// LeftPathParts := strings.Split(AbsLeftPath , Separator)
// RightPathParts := strings.Split(AbsRightPath, Separator)
// LeftLen := len(LeftPathParts)
// RightLen := len(RightPathParts)
// fmt.Println(LeftPathParts)
// fmt.Println(RightPathParts)
// fmt.Println(max_width, LeftLen, RightLen, len(LeftPath), len(RightPath))
LeftPath := left_path
RightPath := right_path
if max_width == 0 {
return LeftPath,RightPath
}
LeftLen := len(left_path)
RightLen := len(right_path)
if LeftLen > max_width {
LeftPath = "…" + left_path[LeftLen-max_width+3:]
}
if RightLen > max_width {
RightPath = "…" + right_path[RightLen-max_width+3:]
}
return LeftPath,RightPath
}// >>>
func printSideBySide(contents *[]Entry) {// <<<
var LeftTree = convertSliceToTree(contents, "left")
var RightTree = convertSliceToTree(contents, "right")
var Output string
LeftRoot := (*contents)[0].Path["left"]
RightRoot := (*contents)[0].Path["right"]
var LeftRootDisplay string = LeftRoot
var RightRootDisplay string = RightRoot
if Arg_LeftAlias != "" {
LeftRootDisplay = Arg_LeftAlias
}
if Arg_RightAlias != "" {
RightRootDisplay = Arg_RightAlias
}
// if Arg_ShortenRoot {
var ColumnWidth int = 0
TermWidth, _, Err := term.GetSize(0)
if Err == nil {
ColumnWidth = (TermWidth-RightSideOffset)/2
}
// if (len(LeftRootDisplay) > ColumnWidth) || (len(RightRootDisplay) > ColumnWidth) { // only shorten if necessary
LeftRootDisplay, RightRootDisplay = shortenPath(LeftRootDisplay, RightRootDisplay, ColumnWidth)
// }
// }
// if LeftRoot != LeftRootDisplay {
LeftTree.Node.SetText(StyleRoot.Render(LeftRootDisplay))
// }
// if RightRoot != RightRootDisplay {
RightTree.Node.SetText(StyleRoot.Render(RightRootDisplay))
// }
filterTrees(&LeftTree.Node, &RightTree.Node)
if Arg_Swap {
LeftTree, RightTree = RightTree, LeftTree
}
Output = lipgloss.JoinHorizontal(lipgloss.Top, strings.Join(LeftTree.RenderTree(), "\n"), strings.Join(RightTree.SetRenderOffset(RightSideOffset).RenderTree(), "\n"))
fmt.Println(Output)
}// >>>
func shouldHideEntry(E *Entry) bool {// <<<
// THIS FUNCTION WAS GENERATED USING AI BASED ON THE FILTERTREES() FUNCTION.
// THE CODE SEEMS TO MAKE SENSE AND SEEMS TO WORK.
// --- 1. Universal Filters (Orphans) ---
if Arg_Orphans && (!E.IsOrphan["left"] && !E.IsOrphan["right"]) {
return true
} else if Arg_NoOrphans && (E.IsOrphan["left"] || E.IsOrphan["right"]) {
return true
} else if Arg_LeftOrphans && !E.IsOrphan["left"] {
return true
} else if Arg_RightOrphans && !E.IsOrphan["right"] {
return true
}
// --- 2. Type-Specific Filters ---
if E.IsDir {
if Arg_Files {
return true
}
// Note: Arg_NoEmpty cannot be checked here easily for flat view
// without knowing about children. For flat view, we might just
// ignore --no-empty, or we'd need a pre-pass.
// For now, let's assume it doesn't apply to flat view or we accept it won't work there yet.
} else {
if Arg_Folders {
return true
}
// --- 3. Diff/Same Logic ---
var isSame bool = false
if Arg_Size {
isSame = (E.SizeDiff["left"] == SameSize && E.SizeDiff["right"] == SameSize)
} else if Arg_Time {
isSame = (E.TimeDiff["left"] == SameTime && E.TimeDiff["right"] == SameTime)
} else {
isSame = !E.IsDiff
}
if Arg_Diff && isSame {
return true
} else if Arg_Same && !isSame {
return true
}
}
return false
}// >>>
func printPlain(contents *[]Entry, QuoteChar string) {// <<<
var Left string = "left"
var Right string = "right"
if Arg_Swap {
Left, Right= Right, Left
}
for i:=1; i < len(*contents); i++ {
if !shouldHideEntry(&(*contents)[i]) {
fmt.Printf("%s%s%s %s%s%s\n", QuoteChar, (*contents)[i].Path[Left], QuoteChar, QuoteChar, (*contents)[i].Path[Right], QuoteChar)
}
}
}// >>>
// vim: fdm=marker fmr=<<<,>>>