Skip to content

Commit f803615

Browse files
author
LoneWandererProductions
committed
well it is time to generate a public facade for Dataformatter
1 parent e901498 commit f803615

4 files changed

Lines changed: 81 additions & 8 deletions

File tree

CommonLibraryTests/IoFileSearch.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
* PROGRAMER: Peter Geinitz (Wayfarer)
77
*/
88

9-
using System;
109
using System.Collections.Generic;
1110
using System.IO;
1211
using System.Threading.Tasks;

CoreBuilder/UI/LogWindow.xaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,26 @@
1616
</MenuItem>
1717

1818
<MenuItem Header="_Options">
19-
<MenuItem>
19+
<Menu>
2020
<CheckBox x:Name="AutoScrollCheck"
2121
Content="Auto Scroll"
2222
IsChecked="True" />
23-
</MenuItem>
24-
<MenuItem>
23+
</Menu>
24+
<Menu>
2525
<CheckBox x:Name="ShowTimestampCheck"
2626
Content="Show Timestamp"
2727
IsChecked="False" />
28-
</MenuItem>
28+
</Menu>
2929
</MenuItem>
3030
</Menu>
3131

3232
<!-- Log Area -->
3333
<ScrollViewer x:Name="ScrollViewer"
3434
VerticalScrollBarVisibility="Auto">
35-
<TextBlock x:Name="LogText"
35+
<TextBox x:Name="LogText"
36+
Cursor="Arrow"
37+
IsReadOnly="True"
38+
Focusable="True"
3639
FontFamily="Consolas"
3740
TextWrapping="Wrap"
3841
Margin="10" />
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/*
2+
* COPYRIGHT: See COPYING in the top level directory
3+
* PROJECT: DataFormatter
4+
* FILE: FormatterApiFacade.cs
5+
* PURPOSE: Api Facade for the DataFormatter library
6+
* PROGRAMER: Peter Geinitz (Wayfarer)
7+
*/
8+
9+
using System.Collections.Generic;
10+
11+
namespace DataFormatter
12+
{
13+
public static class FormatterApiFacade
14+
{
15+
/// <summary>
16+
/// Reads the CSV.
17+
/// </summary>
18+
/// <param name="file">The file.</param>
19+
/// <param name="sep">The sep.</param>
20+
/// <returns>Csv file as list.</returns>
21+
public static List<List<string>> ReadCsv(string file, char sep) => CsvHandler.ReadCsv(file, sep);
22+
23+
/// <summary>
24+
/// Writes the CSV.
25+
/// </summary>
26+
/// <param name="file">The file.</param>
27+
/// <param name="data">The data.</param>
28+
/// <param name="sep">The sep.</param>
29+
public static void WriteCsv(string file, IEnumerable<List<string>> data, string sep) => CsvHandler.WriteCsv(file, data, sep);
30+
31+
/// <summary>
32+
/// Reads the CSV with layers.
33+
/// </summary>
34+
/// <param name="file">The file.</param>
35+
/// <param name="layerKeyword">The layer keyword.</param>
36+
/// <returns>Content of our special format file</returns>
37+
public static List<string> ReadCsvWithLayers(string file, string layerKeyword)
38+
=> SegmentedCsvHandler.ReadCsvWithLayerKeywords(file, layerKeyword);
39+
40+
/// <summary>
41+
/// Writes the CSV with layers.
42+
/// </summary>
43+
/// <param name="file">The file.</param>
44+
/// <param name="sep">The sep.</param>
45+
/// <param name="csvLayers">The CSV layers.</param>
46+
/// <param name="layerKeyword">The layer keyword.</param>
47+
public static void WriteCsvWithLayers(string file, char sep, List<List<string>> csvLayers, string layerKeyword)
48+
=> SegmentedCsvHandler.WriteCsvWithLayerKeywords(file, sep, csvLayers, layerKeyword);
49+
50+
/// <summary>
51+
/// Reads the file.
52+
/// </summary>
53+
/// <param name="path">The path.</param>
54+
/// <returns>the values as String[]. Can return null.</returns>
55+
public static IEnumerable<string> ReadFile(string path) => ReadText.ReadFile(path);
56+
57+
/// <summary>
58+
/// Writes the file.
59+
/// </summary>
60+
/// <param name="path">The path.</param>
61+
/// <param name="content">The content.</param>
62+
public static void WriteFile(string path, IEnumerable<string> content) => ReadText.WriteFile(path, content);
63+
64+
/// <summary>
65+
/// Reads the object.
66+
/// </summary>
67+
/// <param name="path">The path.</param>
68+
/// <returns>Readable Obj File</returns>
69+
public static ObjFile ReadObj(string path) => ReaderObj.ReadObj(path);
70+
}
71+
}

DataFormatter/SegmentedCsvHandler.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
namespace DataFormatter
1313
{
1414
/// <summary>
15-
/// Separate multible csv files via keywords.
15+
/// Separate multiple csv files via keywords.
1616
/// </summary>
1717
public static class SegmentedCsvHandler
1818
{
1919
/// <summary>
2020
/// Writes the CSV with layer keywords.
2121
/// </summary>
22-
/// <param name="filepath">The filepath.</param>
22+
/// <param name="filepath">The file path.</param>
2323
/// <param name="separator">The separator.</param>
2424
/// <param name="csvLayers">The CSV layers.</param>
2525
/// <param name="layerKeyword">The layer keyword.</param>

0 commit comments

Comments
 (0)