本文整理汇总了C++中IsObject函数的典型用法代码示例。如果您正苦于以下问题:C++ IsObject函数的具体用法?C++ IsObject怎么用?C++ IsObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsObject函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TITANIUM_FUNCTION
TITANIUM_FUNCTION(ListView, replaceSectionAt)
{
const auto js_context = this_object.get_context();
if (arguments.size() >= 2) {
JSObject animation = js_context.CreateObject();
std::vector<std::shared_ptr<ListSection>> sections;
const auto _0 = arguments.at(0);
TITANIUM_ASSERT(_0.IsNumber());
const auto sectionIndex = static_cast<uint32_t>(_0);
const auto _1 = arguments.at(1);
TITANIUM_ASSERT(_1.IsObject());
const auto js_sections = static_cast<JSObject>(_1);
if (js_sections.IsArray()) {
sections = static_cast<JSArray>(js_sections).GetPrivateItems<ListSection>();
} else {
sections.push_back(js_sections.GetPrivate<ListSection>());
}
if (arguments.size() >= 3) {
const auto _2 = arguments.at(2);
if (_2.IsObject()) {
animation = listviewAnimationProperties_ctor__.CallAsConstructor({_2});
}
}
replaceSectionAt(sectionIndex, sections, animation.GetPrivate<ListViewAnimationProperties>());
}
return this_object.get_context().CreateUndefined();
}
示例2: VERIFY
void CFolderHelper::DragOver(TObject *Sender, TObject *Source, int X, int Y, TDragState State, bool &Accept)
{
TElTree* tv = dynamic_cast<TElTree*>(Sender); VERIFY(Sender);
TElTreeItem* tgt;
for (ELVecIt it=drag_items.begin(); it!=drag_items.end(); it++){
TElTreeItem* src=*it;
TSTItemPart IP;
int HCol;
if (!src) Accept = false;
else{
tgt = tv->GetItemAt(X, Y, IP, HCol);
if (tgt){
if (IsFolder(src)){
bool b = true;
for (TElTreeItem* itm=tgt->Parent; itm; itm=itm->Parent) if (itm==src){b=false; break;}
if (IsFolder(tgt)){
Accept = b&&(tgt!=src)&&(src->Parent!=tgt);
}else if (IsObject(tgt)){
Accept = b&&(src!=tgt->Parent)&&(tgt!=src)&&(tgt->Parent!=src->Parent);
}
}else if (IsObject(src)){
if (IsFolder(tgt)){
Accept = (tgt!=src)&&(src->Parent!=tgt);
}else if (IsObject(tgt)){
Accept = (tgt!=src)&&(src->Parent!=tgt->Parent);
}
}
}else Accept = !!src->Parent;
}
if (false==Accept) return;
}
}
示例3: get_context
void TableViewRow::ensureRowLabel()
{
if (title__ == nullptr) {
const auto Titanium_property = get_context().get_global_object().GetProperty("Titanium");
TITANIUM_ASSERT(Titanium_property.IsObject());
const auto Titanium = static_cast<JSObject>(Titanium_property);
const auto UI_property = Titanium.GetProperty("UI");
TITANIUM_ASSERT(UI_property.IsObject());
const auto UI = static_cast<JSObject>(UI_property);
const auto Label_property = UI.GetProperty("Label");
TITANIUM_ASSERT(Label_property.IsObject());
auto Label = static_cast<JSObject>(Label_property);
const auto label = Label.CallAsConstructor();
title__ = label.GetPrivate<TitaniumWindows::UI::Label>();
title__->set_text("");
title__->getViewLayoutDelegate()->set_left("0");
EnsureRowComponentWidth(title__->getViewLayoutDelegate<WindowsViewLayoutDelegate>()->getComponent());
add(label);
}
}
示例4: TITANIUM_FUNCTION
TITANIUM_FUNCTION(TableView, insertSectionBefore)
{
TITANIUM_LOG_WARN("TableView.insertSectionBefore is not implemented yet");
if (arguments.size() < 3) {
return get_context().CreateUndefined();
} else if (arguments.size() >= 3) {
const auto _0 = arguments.at(0);
TITANIUM_ASSERT(_0.IsNumber());
const auto _1 = arguments.at(1);
TITANIUM_ASSERT(_1.IsObject());
const auto _2 = arguments.at(2);
//TITANIUM_ASSERT(_2.IsTableViewAnimationProperties());
const double index = static_cast<double>(_0);
const auto section = static_cast<JSObject>(_1);
const auto animation = static_cast<JSObject>(_2);
// insertSectionBefore(index, section, animation);
} else if (arguments.size() >= 2) {
const auto _0 = arguments.at(0);
TITANIUM_ASSERT(_0.IsNumber());
const auto _1 = arguments.at(1);
TITANIUM_ASSERT(_1.IsObject());
const double index = static_cast<double>(_0);
const auto section = static_cast<JSObject>(_1);
// insertSectionBefore(index, section);
} else if (arguments.size() >= 1) {
const auto _0 = arguments.at(0);
TITANIUM_ASSERT(_0.IsNumber());
const double index = static_cast<double>(_0);
// insertSectionBefore(index);
}
return get_context().CreateUndefined();
}
示例5: TITANIUM_FUNCTION
TITANIUM_FUNCTION(DependencyObject, SetValue)
{
auto context = get_context();
if (arguments.size() == 2) {
auto _0 = arguments.at(0);
TITANIUM_ASSERT_AND_THROW(_0.IsObject(), "Expected Object");
auto object_dp = static_cast<JSObject>(_0);
auto wrapper_dp = object_dp.GetPrivate<Windows::UI::Xaml::DependencyProperty>();
// FIXME What if the type we want here is some parent class of the actual wrapper's class? I think we'll get nullptr here.
// We need some way to know the underlying type the JSObject maps to, get that, then cast to the type we want...
auto dp = wrapper_dp->unwrapWindows_UI_Xaml_DependencyProperty();
auto _1 = arguments.at(1);
TITANIUM_ASSERT_AND_THROW(_1.IsObject(), "Expected Object");
auto object_value = static_cast<JSObject>(_1);
auto wrapper_value = object_value.GetPrivate<Platform::Object>();
// FIXME What if the type we want here is some parent class of the actual wrapper's class? I think we'll get nullptr here.
// We need some way to know the underlying type the JSObject maps to, get that, then cast to the type we want...
auto value = wrapper_value->unwrapPlatform_Object();
unwrap()->SetValue(dp, value);
return context.CreateUndefined();
}
// Catch-all if no arg count matches!
TITANIUM_LOG_DEBUG("No method signature matched DependencyObject::SetValue with # of args: ", arguments.size());
return context.CreateUndefined();
}
开发者ID:appcelerator-forks,项目名称:appcelerator.titanium_mobile_windows,代码行数:30,代码来源:Windows.UI.Xaml.DependencyObject.cpp
示例6: TITANIUM_FUNCTION
TITANIUM_FUNCTION(ListSection, replaceItemsAt)
{
const auto js_context = this_object.get_context();
if (arguments.size() >= 3) {
const auto _0 = arguments.at(0);
TITANIUM_ASSERT(_0.IsNumber());
const auto _1 = arguments.at(1);
TITANIUM_ASSERT(_1.IsNumber());
const auto _2 = arguments.at(2);
TITANIUM_ASSERT(_2.IsObject());
JSObject animation = js_context.CreateObject();
const auto index = static_cast<std::uint32_t>(_0);
const auto count = static_cast<std::uint32_t>(_1);
const auto dataItems = js_to_ListDataItem_array(static_cast<JSObject>(_2));
if (arguments.size() >= 4) {
const auto _3 = arguments.at(3);
if (_3.IsObject()) {
animation = listviewAnimationProperties_ctor__.CallAsConstructor({ _3 });
}
}
replaceItemsAt(index, count, dataItems, animation.GetPrivate<ListViewAnimationProperties>());
}
return get_context().CreateUndefined();
}
示例7: TITANIUM_FUNCTION
TITANIUM_FUNCTION(View, animateCamera)
{
if (arguments.size() > 1) {
auto _0 = arguments.at(0);
auto _1 = arguments.at(1);
TITANIUM_ASSERT(_0.IsObject());
TITANIUM_ASSERT(_1.IsObject());
auto callback = static_cast<JSObject>(_1);
animateCamera(js_to_CameraAnimationParams(static_cast<JSObject>(_0)), callback);
}
return get_context().CreateUndefined();
}
示例8: R_ASSERT
BOOL CFolderHelper::RemoveItem(TElTree* tv, TElTreeItem* pNode, TOnItemRemove OnRemoveItem, TOnItemAfterRemove OnAfterRemoveItem)
{
bool bRes = false;
R_ASSERT(OnRemoveItem);
if (pNode){
tv->IsUpdating = true;
TElTreeItem* pSelNode = pNode->GetPrevSibling();
if (!pSelNode) pSelNode = pNode->GetNextSibling();
AnsiString full_name;
if (IsFolder(pNode)){
// if (mrYes==MessageDlg("Delete selected folder?", mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0))
{
bRes = true;
for (TElTreeItem* item=pNode->GetFirstChild(); item&&(item->Level>pNode->Level); item=item->GetNext()){
MakeName(item,0,full_name,false);
if (IsObject(item)){
bool res = true;
OnRemoveItem(full_name.c_str(),TYPE_OBJECT,res);
if (!res) bRes = FALSE;
}
}
if (bRes){
MakeName(pNode,0,full_name,true);
bool res = true;
OnRemoveItem(full_name.c_str(),TYPE_FOLDER,res);
pNode->Delete();
if (!OnAfterRemoveItem.empty()) OnAfterRemoveItem();
}
}
}
if (IsObject(pNode)){
// if (mrYes==MessageDlg("Delete selected item?", mtConfirmation, TMsgDlgButtons() << mbYes << mbNo, 0))
{
MakeName (pNode,0,full_name,false);
OnRemoveItem(full_name.c_str(),TYPE_OBJECT,bRes);
if (bRes){
pNode->Delete();
if (!OnAfterRemoveItem.empty()) OnAfterRemoveItem();
}
}
}
if (bRes) tv->Selected = pSelNode;
tv->IsUpdating = false;
tv->SetFocus();
}else{
Msg ("#At first select item.");
}
return bRes;
}
示例9: TITANIUM_FUNCTION
TITANIUM_FUNCTION(CoreDispatcher, RunIdleAsync)
{
auto context = get_context();
if (arguments.size() == 1) {
auto _0 = arguments.at(0);
TITANIUM_ASSERT_AND_THROW(_0.IsObject(), "Expected Object");
auto object_agileCallback = static_cast<JSObject>(_0);
auto wrapper_agileCallback = object_agileCallback.GetPrivate<Windows::UI::Core::IdleDispatchedHandler>();
// FIXME What if the type we want here is some parent class of the actual wrapper's class? I think we'll get nullptr here.
// We need some way to know the underlying type the JSObject maps to, get that, then cast to the type we want...
auto agileCallback = wrapper_agileCallback->unwrapWindows_UI_Core_IdleDispatchedHandler();
auto method_result = unwrap()->RunIdleAsync(agileCallback);
auto result = context.CreateObject(JSExport<Windows::Foundation::IAsyncAction>::Class());
auto result_wrapper = result.GetPrivate<Windows::Foundation::IAsyncAction>();
result_wrapper->wrap(method_result);
return result;
}
// Catch-all if no arg count matches!
TITANIUM_LOG_DEBUG("No method signature matched CoreDispatcher::RunIdleAsync with # of args: ", arguments.size());
return context.CreateUndefined();
}
开发者ID:appcelerator-forks,项目名称:appcelerator.titanium_mobile_windows,代码行数:26,代码来源:Windows.UI.Core.CoreDispatcher.cpp
示例10: assert
JSONValue JSONValue::CreateChild(const String& name, JSONValueType valueType)
{
assert(IsObject());
if (!IsObject())
return JSONValue::EMPTY;
Value jsonValue;
if (valueType == JSON_OBJECT)
jsonValue.SetObject();
else if (valueType == JSON_ARRAY)
jsonValue.SetArray();
AddMember(name, jsonValue);
return GetChild(name, valueType);
}
示例11: IsObjectType
bool IsObjectType(void) const
{
if (!IsObject())
return false;
return (dynamic_cast<T *>(boost::get<Object::Ptr>(m_Value).get()) != NULL);
}
示例12: pFetcher
std::shared_ptr<rapidjson::Document> ListingFetch::fetch(std::string singleUrl)
{
std::unique_ptr<FetchJob_Curl> pFetcher(new FetchJob_Curl(singleUrl));
bool res = pFetcher->run();
if (res == false)
{
DEBUG_PRINT("Fetch failed from URL: " << singleUrl << std::endl);
return nullptr;
}
else
{
DEBUG_PRINT("Read " << pFetcher->getSize() << " bytes from URL: " << singleUrl << std::endl);
}
auto spJsonDoc = std::make_shared<rapidjson::Document>();
spJsonDoc->Parse(pFetcher->getData());
if (spJsonDoc->IsObject() && spJsonDoc->HasMember("jsontv"))
{
DEBUG_PRINT("Parsed a valid JSONTV document." << std::endl);
return spJsonDoc;
}
else
{
DEBUG_PRINT("JSON parse failed!" << std::endl);
return nullptr;
}
}
示例13: strdup
template<typename VALUE_T>uint32_t
Document_t<VALUE_T>::Locate(uint32_t pos, const char *path) const
{
char *cur, *next, *_path = strdup(path);
for (cur = _path; cur != NULL; cur = next) {
if ((next = strchr(cur, '.')) != NULL) *next++ = 0;
if (strlen(cur) == strspn(cur, "0123456789")) {
if (!IsArray(pos)) {
pos = UINT32_MAX; goto quit0;
}
uint32_t idx = atol(cur);
if (idx >= GetArraySpace(pos)) {
pos = UINT32_MAX; goto quit0;
}
pos = GetArray(pos, idx);
} else {
if (!IsObject(pos)) {
pos = UINT32_MAX; goto quit0;
}
if ((pos = ObjectSearch(pos, cur)) == UINT32_MAX) {
pos = UINT32_MAX; goto quit0;
}
}
}
quit0:
free(_path);
return pos;
}
示例14: PASSERT
AnimationMaster AnimationMaster::Unserialize(Renderer* renderer,
rapidjson::Value* value) {
PASSERT( value->IsObject(), "AnimationMaster cannot unserialize because passed is not an object (Note: This may indicate parsing failure)");
PASSERT(value->FindMember("animations")->value.IsArray(), "AnimationMaster cannot unserialize because animations field is not an array");
PASSERT(value->FindMember("default")->value.IsString(), "AnimationMaster default should be string");
std::map<PBase::String, AnimationSetEntry> anims;
rapidjson::Value* animations = &value->FindMember("animations")->value;
for (auto it = animations->Begin(); it != animations->End(); it++) {
PASSERT(it->IsObject(), "AnimationMaster animation entry should be an object");
PASSERT(it->FindMember("name")->value.IsString(), "AnimationMaster animation entry name should be string");
PASSERT(it->FindMember("animation_file")->value.IsString(), "AnimationMaster animation file path should be string");
String after;
if (it->HasMember("after")) {
PASSERT(it->FindMember("after")->value.IsString(), "after should be a string animation identifier");
after = it->FindMember("after")->value.GetString();
}
anims[it->FindMember("name")->value.GetString()] = AnimationSetEntry(
renderer->LoadAnimationSet(it->FindMember("animation_file")->value.GetString()),
after);
}
return AnimationMaster(value->FindMember("default")->value.GetString(), anims);
}
示例15: assert
const JSON * JsonReader::GetChildByName( const char * childName ) const
{
assert( IsObject() );
// Check if the the cached child pointer is valid.
if ( !Parent->Children.IsNull( Child ) )
{
if ( OVR_strcmp( Child->Name, childName ) == 0 )
{
const JSON * c = Child;
Child = c->pNext; // Cache the next child.
return c;
}
}
// Itereate over all children.
for ( const JSON * c = Parent->Children.GetFirst(); !Parent->Children.IsNull( c ); c = c->pNext )
{
if ( OVR_strcmp( c->Name, childName ) == 0 )
{
Child = c->pNext; // Cache the next child.
return c;
}
}
return 0;
}