本文整理汇总了C++中SrsAmf0Any::is_boolean方法的典型用法代码示例。如果您正苦于以下问题:C++ SrsAmf0Any::is_boolean方法的具体用法?C++ SrsAmf0Any::is_boolean怎么用?C++ SrsAmf0Any::is_boolean使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SrsAmf0Any
的用法示例。
在下文中一共展示了SrsAmf0Any::is_boolean方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
amf0_bool srs_amf0_is_boolean(srs_amf0_t amf0)
{
SrsAmf0Any* any = (SrsAmf0Any*)amf0;
return any->is_boolean();
}
示例2: TEST
//.........这里部分代码省略.........
o = SrsAmf0Any::number(10);
SrsAutoFree(SrsAmf0Any, o);
EXPECT_EQ(ERROR_SUCCESS, o->write(&s));
EXPECT_EQ(o->total_size(), s.pos());
s.reset();
SrsAmf0Any* po = NULL;
EXPECT_EQ(ERROR_SUCCESS, srs_amf0_read_any(&s, &po));
ASSERT_TRUE(NULL != po);
SrsAutoFree(SrsAmf0Any, po);
ASSERT_TRUE(po->is_number());
EXPECT_DOUBLE_EQ(10, po->to_number());
}
// any: boolean
if (true) {
s.reset();
o = SrsAmf0Any::boolean(true);
SrsAutoFree(SrsAmf0Any, o);
EXPECT_EQ(ERROR_SUCCESS, o->write(&s));
EXPECT_EQ(o->total_size(), s.pos());
s.reset();
SrsAmf0Any* po = NULL;
EXPECT_EQ(ERROR_SUCCESS, srs_amf0_read_any(&s, &po));
ASSERT_TRUE(NULL != po);
SrsAutoFree(SrsAmf0Any, po);
ASSERT_TRUE(po->is_boolean());
EXPECT_TRUE(po->to_boolean());
}
// any: null
if (true) {
s.reset();
o = SrsAmf0Any::null();
SrsAutoFree(SrsAmf0Any, o);
EXPECT_EQ(ERROR_SUCCESS, o->write(&s));
EXPECT_EQ(o->total_size(), s.pos());
s.reset();
SrsAmf0Any* po = NULL;
EXPECT_EQ(ERROR_SUCCESS, srs_amf0_read_any(&s, &po));
ASSERT_TRUE(NULL != po);
SrsAutoFree(SrsAmf0Any, po);
ASSERT_TRUE(po->is_null());
}
// any: undefined
if (true) {
s.reset();
o = SrsAmf0Any::undefined();
SrsAutoFree(SrsAmf0Any, o);
EXPECT_EQ(ERROR_SUCCESS, o->write(&s));
EXPECT_EQ(o->total_size(), s.pos());