Xamarin Public Jenkins (auto-signing) e79aa3c0ed Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
2016-08-03 10:59:49 +00:00

37 lines
713 B
C#

using System.Text.RegularExpressions;
namespace Mono
{
class StackTraceMetadata
{
static Regex regex = new Regex (@"\[(?<Id>.+)\] (?<Value>.+)");
public readonly string Id;
public readonly string Value;
public readonly string Line;
private StackTraceMetadata (string line, string id, string val)
{
Line = line;
Id = id;
Value = val;
}
public static bool TryParse (string line, out StackTraceMetadata metadata)
{
metadata = null;
var match = regex.Match (line);
if (!match.Success)
return false;
string id = match.Groups ["Id"].Value;
string val = match.Groups ["Value"].Value;
metadata = new StackTraceMetadata (line, id, val);
return true;
}
}
}