/// <summary>
/// Version
/// </summary>
public class Version : IComparable<Version>
{
/// <summary>
/// Major version
/// </summary>
public readonly int Major = 0;
/// <summary>
/// Minor version
/// </summary>
public readonly int Minor = 0;
/// <summary>
/// Build number
/// </summary>
public readonly int Build = 0;
/// <summary>
/// Revision
/// </summary>
public readonly int Revision = 0;
private readonly int hash;
/// <summary>
/// Version
/// </summary>
/// <param name="version"></param>
public Version(string version)
{
string[] versions = version.Split('.');
if (versions == null)
{
throw new Exception("Can't parse version from string: " + version);
}
if (versions.Length != 4)
{
throw new Exception("Can't parse version from string — wrong count of numbers: " + version);
}
if (int.TryParse(versions[0], out int major))
{
Major = major;
}
else
{
throw new Exception("Can't parse major version from string: " + versions[0]);
}
if (int.TryParse(versions[1], out int minor))
{
Minor = minor;
}
else
{
throw new Exception("Can't parse minor version from string: " + versions[1]);
}
if (int.TryParse(versions[2], out int build))
{
Build = build;
}
else
{
throw new Exception("Can't parse build version from string: " + versions[2]);
}
if (int.TryParse(versions[3], out int revisison))
{
Revision = revisison;
}
else
{
throw new Exception("Can't parse revisison version from string: " + versions[3]);
}
hash = ToString().GetHashCode();
}
/// <summary>
/// Versions compare
/// </summary>
/// <param name="other"></param>
/// <returns></returns>
public int CompareTo(Version other)
{
if (Major > other.Major) { return 1; }
if (Major < other.Major) { return -1; }
// Major == other.Major
if (Minor > other.Minor) { return 1; }
if (Minor < other.Minor) { return -1; }
// Minor == other.Minor
if (Build > other.Build) { return 1; }
if (Build < other.Build) { return -1; }
// Build == other.Build
if (Revision > other.Revision) { return 1; }
if (Revision < other.Revision) { return -1; }
// Revision == other.Revision
return 0;
}
/// <summary>
/// Bigger?
/// </summary>
/// <param name="left"></param>
/// <param name="right"></param>
/// <returns></returns>
public static bool operator >(Version left, Version right)
{
return left.CompareTo(right) == 1;
}
/// <summary>
/// Less?
/// </summary>
/// <param name="left"></param>
/// <param name="right"></param>
/// <returns></returns>
public static bool operator <(Version left, Version right)
{
return left.CompareTo(right) == -1;
}
/// <summary>
/// Bigger or equal?
/// </summary>
/// <param name="left"></param>
/// <param name="right"></param>
/// <returns></returns>
public static bool operator >=(Version left, Version right)
{
return left.CompareTo(right) >= 0;
}
/// <summary>
/// Less or equal?
/// </summary>
/// <param name="left"></param>
/// <param name="right"></param>
/// <returns></returns>
public static bool operator <=(Version left, Version right)
{
return left.CompareTo(right) <= 0;
}
/// <summary>
/// Convert version to string
/// </summary>
/// <returns></returns>
public override string ToString()
{
return string.Format("{0}.{1}.{2}.{3}", Major, Minor, Build, Revision);
}
/// <summary>
/// Get hash
/// </summary>
/// <returns></returns>
public override int GetHashCode()
{
return hash;
}
}
/// <summary>
/// Class description
/// </summary>
public class SomeClass { }
doxygen.exe doxyproject
Водяное охлаждение Deepcool Captain 360 EX RGB White
почему 128 гб мало? я думаю его сделать под систему, а жесткий диск под хранилище. зачем мне больше?
Жесткий диск 3.5" Toshiba P300 1Tb
SSD накопитель M.2 128Gb Intel 760p
Class: http.ServerResponse
Added in: v0.1.17
This object is created internally by an HTTP server — not by the user. It is passed as the second parameter to the 'request' event.
The response inherits from Stream, and additionally implements the following:
Calling the writable.end() method signals that no more data will be written to the Writable. The optional chunk and encoding arguments allow one final additional chunk of data to be written immediately before closing the stream. If provided, the optional callback function is attached as a listener for the 'finish' event.
Вызов метода writable.end() сигнализирует о том, что в открытый для записи стрим больше не поступает данных на запись. Опциональные аргументы chunk и encoding позволяют последней дополнительной порции данных быть записанной непосредственно перед закрытием стрима. При предоставлении опциональной функции callback, она добавляется как слушатель события ‘finish’.
Вызов метода stream.write() после вызова stream.end() приведет к ошибке.