本文整理汇总了C++中IsObject函数的典型用法代码示例。如果您正苦于以下问题:C++ IsObject函数的具体用法?C++ IsObject怎么用?C++ IsObject使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IsObject函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:appcelerator-forks,项目名称:appcelerator.titanium_mobile_windows,代码行数:32,代码来源:ListView.cpp
示例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;
}
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:33,代码来源:FolderLib.cpp
示例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);
}
}
开发者ID:garymathews,项目名称:titanium_mobile_windows,代码行数:25,代码来源:TableViewRow.cpp
示例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();
}
开发者ID:FokkeZB,项目名称:titanium_mobile_windows,代码行数:32,代码来源:TableView.cpp
示例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();
}
开发者ID:jonasbjurhult,项目名称:titanium_mobile_windows,代码行数:27,代码来源:ListSection.cpp
示例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();
}
开发者ID:FokkeZB,项目名称:titanium_mobile_windows,代码行数:12,代码来源:View.cpp
示例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;
}
开发者ID:OLR-xray,项目名称:OLR-3.0,代码行数:49,代码来源:FolderLib.cpp
示例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);
}
开发者ID:Boshin,项目名称:Urho3D,代码行数:16,代码来源:JSONValue.cpp
示例11: IsObjectType
bool IsObjectType(void) const
{
if (!IsObject())
return false;
return (dynamic_cast<T *>(boost::get<Object::Ptr>(m_Value).get()) != NULL);
}
开发者ID:LMNetworks,项目名称:icinga2,代码行数:7,代码来源:value.hpp
示例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;
}
}
开发者ID:friman,项目名称:ipdvr,代码行数:30,代码来源:listingfetch.cpp
示例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;
}
开发者ID:charlesw1234,项目名称:learning,代码行数:28,代码来源:freeze.hpp
示例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);
}
开发者ID:jawline,项目名称:ParticlesEngine,代码行数:30,代码来源:AnimationMaster.cpp
示例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;
}
开发者ID:beijingkaka,项目名称:shellspace,代码行数:25,代码来源:OVR_JSON.cpp
示例16: flags
Qt::ItemFlags JSON_Model::flags(QModelIndex const& index) const
{
// std::lock_guard<std::recursive_mutex> sm(mTreeMutex);
if (!index.isValid())
{
return 0;
}
uint32_t default_flags = Qt::ItemIsEnabled | Qt::ItemIsSelectable;
auto* ti = (Tree_Item*)index.internalPointer();
if (!ti || !ti->m_json)
{
return Qt::ItemFlags(default_flags);
}
auto json = ti->m_json;
if (json->IsObject() || json->IsArray())
{
return Qt::ItemFlags(default_flags);
}
return Qt::ItemFlags((index.column() == 0) ? default_flags : default_flags | Qt::ItemIsEditable);
}
开发者ID:ggggamer,项目名称:silkopter,代码行数:26,代码来源:JSON_Model.cpp
示例17: TITANIUM_FUNCTION
TITANIUM_FUNCTION(File, write)
{
const auto js_context = this_object.get_context();
if (arguments.size() < 1) {
return js_context.CreateUndefined();
}
const auto _0 = arguments.at(0);
const auto _1 = arguments.size() < 2 ? js_context.CreateBoolean(false) : arguments.at(1);
TITANIUM_ASSERT(_1.IsBoolean());
const auto append = static_cast<bool>(_1);
if (_0.IsString()) {
return js_context.CreateBoolean(write(static_cast<std::string>(arguments.at(0)), append));
} else if (_0.IsObject()) {
const auto js_object = static_cast<JSObject>(_0);
const auto blob = js_object.GetPrivate<Titanium::Blob>();
const auto file = js_object.GetPrivate<File>();
if (blob != nullptr) {
return js_context.CreateBoolean(write(blob, append));
} else if (file != nullptr) {
return js_context.CreateBoolean(write(file, append));
}
}
return js_context.CreateNull();
}
开发者ID:appcelerator,项目名称:titanium_mobile_windows,代码行数:28,代码来源:File.cpp
示例18: scope
void ScriptEntity::think( float dt )
{
MagnetiteCore::Singleton->runOnMainThread( [&,dt]() {
// Perhaps a better (thread safe) mechanism for handling callbacks could be devised.
PersistentContext ctx = MagnetiteCore::Singleton->getScriptManager()->getContext();
Context::Scope scope( ctx );
HandleScope hs;
// Get the object prototype, which contains the script-side create.
auto proto = mScriptObject->GetPrototype();
if( proto->IsObject() )
{
auto protobj = proto.As<Object>();
if( protobj->Has( v8::String::New("think") ) ) {
auto createVal = protobj->Get( v8::String::New("think") );
if( createVal->IsFunction() )
{
auto createFunc = createVal.As<Function>();
ValueHandle args[] = { Number::New(dt) };
createFunc->Call( mScriptObject, 1, args );
}
}
}
});
BaseEntity::think(dt);
}
开发者ID:zuzak,项目名称:Magnetite,代码行数:26,代码来源:ScriptEntity.cpp
示例19: TITANIUM_FUNCTION
TITANIUM_FUNCTION(Utils, base64encode)
{
if (arguments.size() >= 1) {
const auto _0 = arguments.at(0);
// Titanium.Blob / Titanium.Filesystem.File
if (_0.IsObject()) {
const auto js_obj = static_cast<JSObject>(_0);
// Titanium.Blob
const auto blob_obj = js_obj.GetPrivate<Blob>();
if (blob_obj != nullptr) {
return static_cast<JSValue>(base64encode(blob_obj)->get_object());
}
// Titanium.Filesystem.File
const auto file_obj = js_obj.GetPrivate<Filesystem::File>();
if (file_obj != nullptr) {
return static_cast<JSValue>(base64encode(file_obj)->get_object());
}
// String
} else if (_0.IsString()) {
auto obj = static_cast<std::string>(_0);
return static_cast<JSValue>(base64encode(obj)->get_object());
}
}
return get_context().CreateUndefined();
}
开发者ID:appcelerator-forks,项目名称:appcelerator.titanium_mobile_windows,代码行数:29,代码来源:Utils.cpp
示例20: size
size_t Json::size() const {
if (IsNull()) return 0;
if (IsObject()) return object().size();
if (IsArray()) return array().size();
if (IsString()) return string().size();
return 1;
}
开发者ID:ospace,项目名称:jsonlite_cpp,代码行数:7,代码来源:jsonlite.cpp
注:本文中的IsObject函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论