public static bool TryParseCompilerMessage(string line, out CSourcePathEntry entry) { if (line != null) { Match m = PatternCompilerMessageSourcePath.Match(line); if (m.Success) { string path = m.Groups[1].Value; int lineNumber = CStringUtils.ParseInt(m.Groups[2].Value, -1); entry = new CSourcePathEntry(path, lineNumber); return(true); } } entry = CSourcePathEntry.Invalid; return(false); }
public static bool TryParse(string line, out CSourcePathEntry element) { Match match = Pattern.Match(line); if (match.Success) { string path = match.Groups[1].ToString(); string lineVal = match.Groups[2].ToString(); int lineNumber; if (int.TryParse(lineVal, out lineNumber)) { element = new CSourcePathEntry(path, lineNumber); return(true); } } element = CSourcePathEntry.Invalid; return(false); }