mirror of
https://github.com/soukoku/ntwain.git
synced 2026-02-25 13:04:07 +08:00
Add implicit string conversions.
This commit is contained in:
@@ -10,34 +10,67 @@ namespace TWAINWorkingGroup
|
|||||||
|
|
||||||
partial struct TW_STR32
|
partial struct TW_STR32
|
||||||
{
|
{
|
||||||
|
public TW_STR32(string value) : this()
|
||||||
|
{
|
||||||
|
Set(value);
|
||||||
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return Get();
|
return Get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static implicit operator string(TW_STR32 value) => value.ToString();
|
||||||
|
public static explicit operator TW_STR32(string value) => new TW_STR32(value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
partial struct TW_STR64
|
partial struct TW_STR64
|
||||||
{
|
{
|
||||||
|
public TW_STR64(string value) : this()
|
||||||
|
{
|
||||||
|
Set(value);
|
||||||
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return Get();
|
return Get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static implicit operator string(TW_STR64 value) => value.ToString();
|
||||||
|
public static explicit operator TW_STR64(string value) => new TW_STR64(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
partial struct TW_STR128
|
partial struct TW_STR128
|
||||||
{
|
{
|
||||||
|
public TW_STR128(string value) : this()
|
||||||
|
{
|
||||||
|
Set(value);
|
||||||
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return Get();
|
return Get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static implicit operator string(TW_STR128 value) => value.ToString();
|
||||||
|
public static explicit operator TW_STR128(string value) => new TW_STR128(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
partial struct TW_STR255
|
partial struct TW_STR255
|
||||||
{
|
{
|
||||||
|
public TW_STR255(string value) : this()
|
||||||
|
{
|
||||||
|
Set(value);
|
||||||
|
}
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return Get();
|
return Get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static implicit operator string(TW_STR255 value) => value.ToString();
|
||||||
|
public static explicit operator TW_STR255(string value) => new TW_STR255(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
partial struct TW_IDENTITY
|
partial struct TW_IDENTITY
|
||||||
|
|||||||
Reference in New Issue
Block a user