Skip to content

Instantly share code, notes, and snippets.

@ryankirkman
Last active December 18, 2015 08:29
Show Gist options
  • Save ryankirkman/5754877 to your computer and use it in GitHub Desktop.
Save ryankirkman/5754877 to your computer and use it in GitHub Desktop.
Parse the Zumero result string described at http://zumero.com/docs/zumero_core.html#zumero_sync into a strongly typed class
using System;
namespace ZumeroUtils
{
public class ZumeroResult
{
public int Partial { get; private set; }
public int Quarantine { get; private set; }
public int BytesUpFull { get; private set; }
public int BytesDownFull { get; private set; }
public int BytesUpCompressed { get; private set; }
public int BytesDownCompressed { get; private set; }
public int ElapsedMsNet { get; private set; }
public int ElapsedMsTotal { get; private set; }
/// <summary>
/// The zumero result format description can be found at:
/// http://zumero.com/docs/zumero_core.html#zumero_sync
/// </summary>
public ZumeroResult (string result)
{
string[] resultData = result.Split (';');
Partial = Int32.Parse(resultData [0]);
Quarantine = Int32.Parse(resultData [1]);
BytesUpFull = Int32.Parse(resultData [2]);
BytesDownFull = Int32.Parse(resultData [3]);
BytesUpCompressed = Int32.Parse(resultData [4]);
BytesDownCompressed = Int32.Parse(resultData [5]);
ElapsedMsNet = Int32.Parse(resultData [6]);
ElapsedMsTotal = Int32.Parse(resultData [7]);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment