Skip to content

Commit

Permalink
Added a new empty class ConfigEntryParser for parsing game configs.
Browse files Browse the repository at this point in the history
  • Loading branch information
xvitaly committed Apr 30, 2024
1 parent 4501eda commit 8c91d5a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
40 changes: 40 additions & 0 deletions src/corelib/ConfigEntryParser.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/**
* SPDX-FileCopyrightText: 2011-2024 EasyCoding Team
*
* SPDX-License-Identifier: GPL-3.0-or-later
*/

using System;

namespace srcrepair.core
{
public sealed class ConfigEntryParser
{
public string Variable { get; private set; }
public string Value { get; private set; }
public string Comment { get; private set; }

private static ConfigEntryParser InternalParse(string Value, bool TryParse)
{
throw new NotImplementedException();
}

public static bool TryParse(string SrcStr, out ConfigEntryParser Parser)
{
Parser = InternalParse(SrcStr, true);
return !(Parser is null);
}

public static ConfigEntryParser Parse(string SrcStr)
{
return InternalParse(SrcStr, false);
}

private ConfigEntryParser(string VariableStr, string ValueStr, string CommentStr)
{
Variable = VariableStr;
Value = ValueStr;
Comment = CommentStr;
}
}
}
1 change: 1 addition & 0 deletions src/corelib/corelib.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<Compile Include="CleanupTarget.cs" />
<Compile Include="CommonSettings.cs" />
<Compile Include="CommonVideo.cs" />
<Compile Include="ConfigEntryParser.cs" />
<Compile Include="DebugStrings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
Expand Down

0 comments on commit 8c91d5a

Please sign in to comment.