这篇教程C++ ARGS_TYPE类代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中ARGS_TYPE类的典型用法代码示例。如果您正苦于以下问题:C++ ARGS_TYPE类的具体用法?C++ ARGS_TYPE怎么用?C++ ARGS_TYPE使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。 在下文中一共展示了ARGS_TYPE类的30个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: QueryObjectMETHOD_RETURN_TYPE PDFDictionaryDriver::QueryObject(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; if(args.Length() != 1 || !args[0]->IsString()) { THROW_EXCEPTION("wrong arguments, pass 1 argument which is a string key"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } std::string key = *String::Utf8Value(args[0]->ToString()); PDFDictionaryDriver* driver = ObjectWrap::Unwrap<PDFDictionaryDriver>(args.This()); if(!driver->TheObject->Exists(key)) { THROW_EXCEPTION("key not found"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } RefCountPtr<PDFObject> anObject = driver->TheObject->QueryDirectObject(key); Handle<Value> result = PDFObjectDriver::CreateDriver(anObject.GetPtr()); SET_FUNCTION_RETURN_VALUE(result);}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:27,
示例2: WriteLiteralStringValueMETHOD_RETURN_TYPE DictionaryContextDriver::WriteLiteralStringValue(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; if(!(args.Length() == 1) || (!args[0]->IsString() && !args[0]->IsArray())) { THROW_EXCEPTION("wrong arguments, pass 1 argument that is a literal string (string) or an array"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } DictionaryContextDriver* driver = ObjectWrap::Unwrap<DictionaryContextDriver>(args.This()); if(!driver->DictionaryContextInstance) { THROW_EXCEPTION("dictinoarycontext object not initialized, create using objectscontext.startDictionary"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } if(args[0]->IsArray()) { std::string string; unsigned long arrayLength = (args[0]->ToObject()->Get(NEW_STRING("length")))->ToObject()->Uint32Value(); for(unsigned long i=0;i<arrayLength;++i) string.push_back((unsigned char)args[0]->ToObject()->Get(i)->ToNumber()->Value()); driver->DictionaryContextInstance->WriteLiteralStringValue(string); } else { driver->DictionaryContextInstance->WriteLiteralStringValue(*String::Utf8Value(args[0]->ToString())); } SET_FUNCTION_RETURN_VALUE(args.This());}
开发者ID:adioslabs,项目名称:HummusJS,代码行数:35,
示例3: OpenFileMETHOD_RETURN_TYPE InputFileDriver::OpenFile(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; if(args.Length() != 1 || !args[0]->IsString()) { THROW_EXCEPTION("wrong arguments. please provide a string for the file path"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } InputFileDriver* driver = ObjectWrap::Unwrap<InputFileDriver>(args.This()); if(!driver) { THROW_EXCEPTION("no driver created...please create one through Hummus"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } if(driver->OpenFile(*String::Utf8Value(args[0]->ToString())) != PDFHummus::eSuccess) { THROW_EXCEPTION("can't open file. make sure path exists"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } SET_FUNCTION_RETURN_VALUE(UNDEFINED);}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:29,
示例4: WriteNameValueMETHOD_RETURN_TYPE DictionaryContextDriver::WriteNameValue(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; if(!(args.Length() == 1) || !args[0]->IsString()) { THROW_EXCEPTION("Wrong arguments, provide a string to write"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } DictionaryContextDriver* driver = ObjectWrap::Unwrap<DictionaryContextDriver>(args.This()); if(!driver->DictionaryContextInstance) { THROW_EXCEPTION("dictinoarycontext object not initialized, create using objectscontext.startDictionary"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } driver->DictionaryContextInstance->WriteNameValue(*String::Utf8Value(args[0]->ToString())); SET_FUNCTION_RETURN_VALUE(args.This());}
开发者ID:adioslabs,项目名称:HummusJS,代码行数:25,
示例5: ReadMETHOD_RETURN_TYPE ByteReaderDriver::Read(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; // k. i'll just read the number of bytes and return an array of them if(args.Length() != 1 || !args[0]->IsNumber()) { THROW_EXCEPTION("Wrong arguments. pass the number of bytes to read"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } ByteReaderDriver* element = ObjectWrap::Unwrap<ByteReaderDriver>(args.This()); IOBasicTypes::LongBufferSizeType bufferSize = args[0]->ToNumber()->Uint32Value(); Byte* buffer = new Byte[bufferSize]; bufferSize = element->mInstance->Read(buffer,(int)bufferSize); // reading int cause that's the maximum that can read (use should read till notended anyways) Local<Array> outBuffer = NEW_ARRAY((int)bufferSize); for(LongBufferSizeType i=0;i<bufferSize;++i) outBuffer->Set(NEW_NUMBER(i), NEW_NUMBER(buffer[i])); delete[] buffer; SET_FUNCTION_RETURN_VALUE(outBuffer);}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:28,
示例6: NewMETHOD_RETURN_TYPE ByteWriterWithPositionDriver::New(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; ByteWriterWithPositionDriver* driver = new ByteWriterWithPositionDriver(); driver->Wrap(args.This()); SET_FUNCTION_RETURN_VALUE(args.This());}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:9,
示例7: NewMETHOD_RETURN_TYPE PDFNullDriver::New(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; PDFNullDriver* driver = new PDFNullDriver(); driver->Wrap(args.This()); SET_FUNCTION_RETURN_VALUE(args.This());}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:9,
示例8: NewMETHOD_RETURN_TYPE DictionaryContextDriver::New(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; DictionaryContextDriver* driver = new DictionaryContextDriver(); driver->Wrap(args.This()); SET_FUNCTION_RETURN_VALUE(args.This());}
开发者ID:adioslabs,项目名称:HummusJS,代码行数:10,
示例9: NewMETHOD_RETURN_TYPE PDFRealDriver::New(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; EXPOSE_EXTERNAL_ARGS(ConstructorsHolder, externalHolder) PDFRealDriver* driver = new PDFRealDriver(); driver->holder = externalHolder; driver->Wrap(args.This()); SET_FUNCTION_RETURN_VALUE( args.This())}
开发者ID:galkahana,项目名称:HummusJS,代码行数:10,
示例10: NewMETHOD_RETURN_TYPE DocumentContextDriver::New(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; DocumentContextDriver* objectsContext = new DocumentContextDriver(); objectsContext->Wrap(args.This()); SET_FUNCTION_RETURN_VALUE(args.This());}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:10,
示例11: NewMETHOD_RETURN_TYPE ResourcesDictionaryDriver::New(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; ResourcesDictionaryDriver* form = new ResourcesDictionaryDriver(); form->Wrap(args.This()); SET_FUNCTION_RETURN_VALUE(args.This());}
开发者ID:n9niwas,项目名称:HummusJS,代码行数:10,
示例12: NewMETHOD_RETURN_TYPE InputFileDriver::New(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; InputFileDriver* inputFile = new InputFileDriver(); if(args.Length() == 1 && args[0]->IsString()) inputFile->OpenFile(*String::Utf8Value(args[0]->ToString())); inputFile->Wrap(args.This()); SET_FUNCTION_RETURN_VALUE(args.This());}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:13,
示例13: GetCopiedObjectIDMETHOD_RETURN_TYPE DocumentCopyingContextDriver::GetCopiedObjectID(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; DocumentCopyingContextDriver* copyingContextDriver = ObjectWrap::Unwrap<DocumentCopyingContextDriver>(args.This()); if(!copyingContextDriver->CopyingContext) { THROW_EXCEPTION("copying context object not initialized, create using pdfWriter.createPDFCopyingContext or PDFWriter.createPDFCopyingContextForModifiedFile"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } if(args.Length() != 1 || !args[0]->IsNumber()) { THROW_EXCEPTION("Wrong arguments. provide 1 arugment, an object ID to check"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } EStatusCodeAndObjectIDType result = copyingContextDriver->CopyingContext->GetCopiedObjectID(args[0]->ToNumber()->Uint32Value()); if(result.first != eSuccess) THROW_EXCEPTION("Unable to find element"); SET_FUNCTION_RETURN_VALUE(NEW_NUMBER(result.second)); }
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:26,
示例14: NewMETHOD_RETURN_TYPE InputFileDriver::New(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; EXPOSE_EXTERNAL_ARGS(ConstructorsHolder, externalHolder) InputFileDriver* inputFile = new InputFileDriver(); inputFile->holder = externalHolder; if(args.Length() == 1 && args[0]->IsString()) inputFile->OpenFile(*UTF_8_VALUE(args[0]->TO_STRING())); inputFile->Wrap(args.This()); SET_FUNCTION_RETURN_VALUE(args.This())}
开发者ID:galkahana,项目名称:HummusJS,代码行数:16,
示例15: CreateReaderMETHOD_RETURN_TYPE CreateReader(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; Handle<Value> instance = PDFReaderDriver::GetNewInstance(args); PDFReaderDriver* driver = ObjectWrap::Unwrap<PDFReaderDriver>(instance->ToObject()); if (args.Length() != 1 || (!args[0]->IsString() && !args[0]->IsObject())) { THROW_EXCEPTION("Wrong arguments, provide 1 string - path to file read, or a read stream object"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } PDFHummus::EStatusCode status; if(args[0]->IsObject()) status = driver->StartPDFParsing(args[0]->ToObject()); else status = driver->StartPDFParsing(std::string(*String::Utf8Value(args[0]->ToString()))); if(status != PDFHummus::eSuccess) { THROW_EXCEPTION("Unable to start parsing PDF file"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } SET_FUNCTION_RETURN_VALUE(instance);}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:28,
示例16: GetInputStreamMETHOD_RETURN_TYPE InputFileDriver::GetInputStream(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; InputFileDriver* driver = ObjectWrap::Unwrap<InputFileDriver>(args.This()); if(!driver) { THROW_EXCEPTION("no driver created...please create one through Hummus"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } if(driver->mInputFileInstance && driver->mInputFileInstance->GetInputStream()) { Handle<Value> result = ByteReaderWithPositionDriver::GetNewInstance(args); ObjectWrap::Unwrap<ByteReaderWithPositionDriver>(result->ToObject())->SetStream(driver->mInputFileInstance->GetInputStream(), false); SET_FUNCTION_RETURN_VALUE(result); } else SET_FUNCTION_RETURN_VALUE(UNDEFINED); }
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:26,
示例17: AppendPDFPageFromPDFMETHOD_RETURN_TYPE DocumentCopyingContextDriver::AppendPDFPageFromPDF(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; DocumentCopyingContextDriver* copyingContextDriver = ObjectWrap::Unwrap<DocumentCopyingContextDriver>(args.This()); if(!copyingContextDriver->CopyingContext) { THROW_EXCEPTION("copying context object not initialized, create using pdfWriter.createPDFCopyingContext"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } if(args.Length() != 1 || !args[0]->IsNumber()) { THROW_EXCEPTION("Wrong arguments. provide a page index to append"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } EStatusCodeAndObjectIDType result = copyingContextDriver->CopyingContext->AppendPDFPageFromPDF(args[0]->ToNumber()->Uint32Value()); if(result.first != eSuccess) { THROW_EXCEPTION("Unable to append page. parhaps the page index is wrong"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } Local<Number> idValue = NEW_NUMBER(result.second); SET_FUNCTION_RETURN_VALUE(idValue); }
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:32,
示例18: MergePDFPageToFormXObjectMETHOD_RETURN_TYPE DocumentCopyingContextDriver::MergePDFPageToFormXObject(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; DocumentCopyingContextDriver* copyingContextDriver = ObjectWrap::Unwrap<DocumentCopyingContextDriver>(args.This()); if(!copyingContextDriver->CopyingContext) { THROW_EXCEPTION("copying context object not initialized, create using pdfWriter.createPDFCopyingContext"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } if(args.Length() != 2 || !FormXObjectDriver::HasInstance(args[0]) || !args[1]->IsNumber()) { THROW_EXCEPTION("Wrong arguments. provide 2 arugments, where the first is a form, and the second is a page index to merge"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } EStatusCode status = copyingContextDriver->CopyingContext->MergePDFPageToFormXObject( ObjectWrap::Unwrap<FormXObjectDriver>(args[0]->ToObject())->FormXObject, args[1]->ToNumber()->Uint32Value()); if(status != eSuccess) THROW_EXCEPTION("Unable to merge page index to form. parhaps the page index is wrong"); SET_FUNCTION_RETURN_VALUE(UNDEFINED);}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:30,
示例19: WriteMETHOD_RETURN_TYPE ByteWriterWithPositionDriver::Write(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; // k. i'll just read the number of bytes and return an array of them if(args.Length() != 1 || !args[0]->IsArray()) { THROW_EXCEPTION("Wrong arguments. pass an array of bytes to write"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } ByteWriterWithPositionDriver* element = ObjectWrap::Unwrap<ByteWriterWithPositionDriver>(args.This()); int bufferSize = args[0]->ToObject()->Get(NEW_STRING("length"))->ToObject()->Uint32Value(); Byte* buffer = new Byte[bufferSize]; for(int i=0;i<bufferSize;++i) buffer[i] = args[0]->ToObject()->Get(i)->ToObject()->Uint32Value(); bufferSize = (int)element->mInstance->Write(buffer,bufferSize); delete[] buffer; SET_FUNCTION_RETURN_VALUE(NEW_NUMBER(bufferSize));}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:26,
示例20: CopyDirectObjectAsIsMETHOD_RETURN_TYPE DocumentCopyingContextDriver::CopyDirectObjectAsIs(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; DocumentCopyingContextDriver* copyingContextDriver = ObjectWrap::Unwrap<DocumentCopyingContextDriver>(args.This()); if(!copyingContextDriver->CopyingContext) { THROW_EXCEPTION("copying context object not initialized, create using pdfWriter.createPDFCopyingContext or PDFWriter.createPDFCopyingContextForModifiedFile"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } if(args.Length() != 1) // need to sometimes check that this is a PDFObject { THROW_EXCEPTION("Wrong arguments. provide 1 arugment, which is PDFObject to copy"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } EStatusCode status = copyingContextDriver->CopyingContext->CopyDirectObjectAsIs(ObjectWrap::Unwrap<PDFObjectDriver>(args[0]->ToObject())->GetObject()); if(status != eSuccess) THROW_EXCEPTION("Unable to merge page index to form. parhaps the page index is wrong"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); }
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:25,
示例21: CopyDirectObjectWithDeepCopyMETHOD_RETURN_TYPE DocumentCopyingContextDriver::CopyDirectObjectWithDeepCopy(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; DocumentCopyingContextDriver* copyingContextDriver = ObjectWrap::Unwrap<DocumentCopyingContextDriver>(args.This()); if(!copyingContextDriver->CopyingContext) { THROW_EXCEPTION("copying context object not initialized, create using pdfWriter.createPDFCopyingContext or PDFWriter.createPDFCopyingContextForModifiedFile"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } if(args.Length() != 1) // need to sometimes check that this is a PDFObject { THROW_EXCEPTION("Wrong arguments. provide 1 arugment, which is PDFObject to copy"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } EStatusCodeAndObjectIDTypeList result = copyingContextDriver->CopyingContext->CopyDirectObjectWithDeepCopy(ObjectWrap::Unwrap<PDFObjectDriver>(args[0]->ToObject())->GetObject()); if(result.first != eSuccess) THROW_EXCEPTION("Unable to copy object, parhaps the object id is wrong"); Local<Array> resultObjectIDs = NEW_ARRAY((unsigned int)result.second.size()); unsigned int index = 0; ObjectIDTypeList::iterator it = result.second.begin(); for(; it != result.second.end();++it) resultObjectIDs->Set(NEW_NUMBER(index++),NEW_NUMBER(*it)); SET_FUNCTION_RETURN_VALUE(resultObjectIDs);}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:32,
示例22: CopyNewObjectsForDirectObjectMETHOD_RETURN_TYPE DocumentCopyingContextDriver::CopyNewObjectsForDirectObject(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; DocumentCopyingContextDriver* copyingContextDriver = ObjectWrap::Unwrap<DocumentCopyingContextDriver>(args.This()); if(!copyingContextDriver->CopyingContext) { THROW_EXCEPTION("copying context object not initialized, create using pdfWriter.createPDFCopyingContext or PDFWriter.createPDFCopyingContextForModifiedFile"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } if(args.Length() != 1 || !args[0]->IsArray()) { THROW_EXCEPTION("Wrong arguments. provide 1 arugment, which is an array of object IDs"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } ObjectIDTypeList objectIDs; Handle<Object> objectIDsArray = args[0]->ToObject(); unsigned int length = objectIDsArray->Get(v8::NEW_STRING("length"))->ToObject()->Uint32Value(); for(unsigned int i=0;i <length;++i) objectIDs.push_back(objectIDsArray->Get(i)->ToNumber()->Uint32Value()); EStatusCode status = copyingContextDriver->CopyingContext->CopyNewObjectsForDirectObject(objectIDs); if(status != eSuccess) THROW_EXCEPTION("Unable to copy elements"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); }
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:34,
示例23: SetPositionFromEndMETHOD_RETURN_TYPE ByteReaderWithPositionDriver::SetPositionFromEnd(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; if(args.Length() != 1 || !args[0]->IsNumber()) { THROW_EXCEPTION("Wrong arguments. pass the position"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } ByteReaderWithPositionDriver* element = ObjectWrap::Unwrap<ByteReaderWithPositionDriver>(args.This()); element->mInstance->SetPositionFromEnd(args[0]->ToNumber()->Uint32Value()); SET_FUNCTION_RETURN_VALUE(args.This());}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:18,
示例24: NotEndedMETHOD_RETURN_TYPE ByteReaderDriver::NotEnded(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; ByteReaderDriver* element = ObjectWrap::Unwrap<ByteReaderDriver>(args.This()); SET_FUNCTION_RETURN_VALUE(NEW_BOOLEAN(element->mInstance->NotEnded()));}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:9,
示例25: ExistsMETHOD_RETURN_TYPE PDFDictionaryDriver::Exists(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; PDFDictionaryDriver* driver = ObjectWrap::Unwrap<PDFDictionaryDriver>(args.This()); if(args.Length() != 1 || !args[0]->IsString()) { THROW_EXCEPTION("wrong arguments, pass 1 argument which is a string key"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } Handle<Boolean> result = NEW_BOOLEAN(driver->TheObject->Exists(*String::Utf8Value(args[0]->ToString()))); SET_FUNCTION_RETURN_VALUE(result);}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:18,
示例26: OpenFileMETHOD_RETURN_TYPE InputFileDriver::OpenFile(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; if(args.Length() != 1 || !args[0]->IsString()) { THROW_EXCEPTION("wrong arguments. please provide a string for the file path"); SET_FUNCTION_RETURN_VALUE(UNDEFINED) }
开发者ID:galkahana,项目名称:HummusJS,代码行数:10,
示例27: GetLengthMETHOD_RETURN_TYPE PDFArrayDriver::GetLength(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; PDFArrayDriver* arrayDriver = ObjectWrap::Unwrap<PDFArrayDriver>(args.This()); Local<Number> result = NEW_NUMBER(arrayDriver->TheObject->GetLength()); SET_FUNCTION_RETURN_VALUE(result);}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:11,
示例28: ToPDFArrayMETHOD_RETURN_TYPE PDFObjectDriver::ToPDFArray(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; PDFObject* anObject = ObjectWrap::Unwrap<PDFObjectDriver>(args.This())->GetObject(); if(anObject->GetType() != PDFObject::ePDFObjectArray) SET_FUNCTION_RETURN_VALUE(UNDEFINED); Handle<Value> newInstance = PDFArrayDriver::GetNewInstance(); ObjectWrap::Unwrap<PDFArrayDriver>(newInstance->ToObject())->TheObject = anObject; SET_FUNCTION_RETURN_VALUE(newInstance);}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:13,
示例29: GetWriteStreamMETHOD_RETURN_TYPE PDFStreamDriver::GetWriteStream(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; PDFStreamDriver* stream = ObjectWrap::Unwrap<PDFStreamDriver>(args.This()); Local<Value> result = stream->holder->GetNewByteWriter(args); ObjectWrap::Unwrap<ByteWriterDriver>(result->TO_OBJECT())->SetStream(stream->PDFStreamInstance->GetWriteStream(), false); SET_FUNCTION_RETURN_VALUE(result)}
开发者ID:galkahana,项目名称:HummusJS,代码行数:14,
示例30: QueryObjectMETHOD_RETURN_TYPE PDFArrayDriver::QueryObject(const ARGS_TYPE& args){ CREATE_ISOLATE_CONTEXT; CREATE_ESCAPABLE_SCOPE; if(args.Length() != 1 || !args[0]->IsNumber()) { THROW_EXCEPTION("wrong arguments, pass 1 argument which is an index in the array"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } PDFArrayDriver* arrayDriver = ObjectWrap::Unwrap<PDFArrayDriver>(args.This()); if(args[0]->ToNumber()->Uint32Value() >= arrayDriver->TheObject->GetLength()) { THROW_EXCEPTION("wrong arguments, pass 1 argument which is a valid index in the array"); SET_FUNCTION_RETURN_VALUE(UNDEFINED); } RefCountPtr<PDFObject> anObject = arrayDriver->TheObject->QueryObject(args[0]->ToNumber()->Uint32Value()); Handle<Value> result = PDFObjectDriver::CreateDriver(anObject.GetPtr()); SET_FUNCTION_RETURN_VALUE(result);}
开发者ID:JoshLaseter,项目名称:HummusJS,代码行数:24,
注:本文中的ARGS_TYPE类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ ARMFunctionInfo类代码示例 C++ ARDrone类代码示例 |