Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 11.0.1 (中文) » UltraLite - C 及 C++ 编程 » API 参考 » UltraLite C++ API 参考

 

ULValue 类

语法
public ULValue
注释

ULValue 类类。

ULValue 类类是存储在 UltraLite 游标中的数据类型的包装。此类允许您存储数据而不必考虑数据类型,并可用于将值传入或传出 UltraLite C++ 组件。

ULValue 类包含许多构造函数和类型转换运算符,因此在大多数情况下可以无缝地使用ULValue 类,而不必显式实例化ULValue 类

可构造对象或通过任何基本 C++ 数据类型对其赋值。还可将其转换为基本 C++ 数据类型。

   x( 5 );       ULValue// Example of ULValue's constructor
   y = 5;        ULValue// Example of ULValue's assignment operator
  int z = y;            // Example of ULValue's cast operator

此示例同样适用于字符串:

   x( UL_TEXT( ULValue"hello" ) );
   y = UL_TEXT( ULValue"hello" );
  y.( buffer, BUFFER_LEN );    GetString// NOTE, there is no cast operator

不必显式构造ULValue 类对象,因为编译器经常会自动执行此操作。例如,要读取列中的值,可使用以下内容:

  int x = table->Get( UL_TEXT( "my_column" ) );

table->Get() 调用返回一个ULValue 类对象。C++ 自动调用类型转换运算符以将其转换为整数。类似地,table->Get() 调用将ULValue 类参数作为列标识符。这样便确定了要读取的列。C++ 自动将 "my_column" 字符串转换为ULValue 类对象。

成员

ULValue 的所有成员(包括所有继承成员)。


GetBinary 函数
GetBinary 函数
GetBinaryLength 函数
GetCombinedStringItem 函数
GetCombinedStringItem 函数
GetString 函数
GetString 函数
GetStringLength 函数
InDatabase 函数
IsNull 函数
SetBinary 函数
SetString 函数
SetString 函数
StringCompare 函数
ULValue 函数
ULValue 函数
ULValue 函数
ULValue 函数
ULValue 函数
ULValue 函数
ULValue 函数
ULValue 函数
ULValue 函数
ULValue 函数
ULValue 函数
ULValue 函数
ULValue 函数
ULValue 函数
ULValue 函数
ULValue 函数
ULValue 函数
ULValue 函数
ULValue 函数
ULValue 函数
ULValue 函数
DECL_DATETIME 运算符
GUID 运算符
bool 运算符
double 运算符
float 运算符
int 运算符
long 运算符
short 运算符
ul_s_big 运算符
ul_u_big 运算符
unsigned char 运算符
unsigned int 运算符
unsigned long 运算符
unsigned short 运算符
operator= 函数
~ULValue 函数