当前位置: 首页>>代码示例>>C++>>正文


C++ emptyString函数代码示例

本文整理汇总了C++中emptyString函数的典型用法代码示例。如果您正苦于以下问题:C++ emptyString函数的具体用法?C++ emptyString怎么用?C++ emptyString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了emptyString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: processFile

int processFile(char *inputFile, char *outputString, int lineNumber)
{
	FILE *infile;
	int stringSize = 80;		// max size of one line in file 
	char inputStr[stringSize];
	struct stat fileStatus;
	int fileSize=0;
	int lineCount=0;
	  
	if (lineNumber < 0)
		  return (-1);

	if ((infile = fopen (inputFile, "r")) == NULL) {
	    printf ("Fatal error opening file %s\n",inputFile);
	    return (0);
	}
    memset (&fileStatus, 0, sizeof(fileStatus));
    if (!stat(inputFile, &fileStatus)) {
      if (S_ISREG(fileStatus.st_mode)) {
        fileSize = fileStatus.st_size;
      }
    }

  while (!feof(infile)) {
    if (fgets (inputStr, stringSize, infile) != NULL) {
      // Skip empty lines
      if (emptyString(inputStr))
        continue;
      // Skip comment lines
      if (inputStr[0] == '#' || inputStr[0] == '!')
        continue;

      lineCount++;
      if (lineNumber == 0)
        continue;
      else
      {
    	  if (lineCount == lineNumber)
    		  break;
      }
    }
  }

  // close file 
  fclose (infile);
  // if number lines requested return the count
  if (lineNumber == 0)
	  return (lineCount);
  // check for input out of range
  if (lineNumber > lineCount)
	  return (-1);
  // return the line selected
  if (lineCount) {
    stripString(inputStr);
    strcpy(outputString, inputStr);
    return(lineCount);
  } 
  else {
    return(-1);
  }
}
开发者ID:errorcodexero,项目名称:drivervision,代码行数:61,代码来源:BaeUtilities.cpp

示例2: href

String HTMLAnchorElement::search() const
{
    String query = href().query();
    return query.isEmpty() ? emptyString() : "?" + query;
}
开发者ID:Channely,项目名称:know-your-chrome,代码行数:5,代码来源:HTMLAnchorElement.cpp

示例3: OS

String NavigatorBase::platform() const
{
#if OS(LINUX)
    if (!String(WEBCORE_NAVIGATOR_PLATFORM).isEmpty())
        return WEBCORE_NAVIGATOR_PLATFORM;
    struct utsname osname;
    DEPRECATED_DEFINE_STATIC_LOCAL(String, platformName, (uname(&osname) >= 0 ? String(osname.sysname) + String(" ") + String(osname.machine) : emptyString()));
    return platformName;
#else
    return WEBCORE_NAVIGATOR_PLATFORM;
#endif
}
开发者ID:hnney,项目名称:webkit,代码行数:12,代码来源:NavigatorBase.cpp

示例4: setExceptionFromComputeErrorCode

WebCLGetInfo WebCLDevice::getInfo(CCenum infoType, ExceptionObject& exception)
{
    if (!WebCLInputChecker::isValidDeviceInfoType(infoType)) {
        setExceptionFromComputeErrorCode(ComputeContext::INVALID_VALUE, exception);
        return WebCLGetInfo();
    }

    CCerror err = 0;
    switch (infoType) {
    case ComputeContext::DEVICE_PROFILE:
        return WebCLGetInfo(String("WEBCL_PROFILE"));
    case ComputeContext::DEVICE_VERSION:
        return WebCLGetInfo(String("WebCL 1.0"));
    case ComputeContext::DEVICE_OPENCL_C_VERSION:
        return WebCLGetInfo(String("WebCL C 1.0"));
    case ComputeContext::DRIVER_VERSION: // Vendor specific. Will return a empty string.
    case ComputeContext::DEVICE_NAME:
    case ComputeContext::DEVICE_VENDOR:
    case ComputeContext::DEVICE_EXTENSIONS:
        return WebCLGetInfo(emptyString());
    case ComputeContext::DEVICE_VENDOR_ID: // Vendor specific.
        return WebCLGetInfo(static_cast<CCuint>(0));
    case ComputeContext::DEVICE_IMAGE_SUPPORT:
    case ComputeContext::DEVICE_AVAILABLE:
    case ComputeContext::DEVICE_COMPILER_AVAILABLE:
        return WebCLGetInfo(true);
    case ComputeContext::DEVICE_MAX_WORK_ITEM_SIZES: { // size_t[]
        Vector<size_t> workItemSizes;
        err = platformObject()->getDeviceInfo(infoType, &workItemSizes);
        if (err == ComputeContext::SUCCESS) {
            Vector<CCuint, 3> values;
            for (size_t i = 0; i < workItemSizes.size(); ++i)
                values.uncheckedAppend(workItemSizes[i]);
            return WebCLGetInfo(values);
        }
        break;
    }
    case ComputeContext::DEVICE_MAX_WORK_GROUP_SIZE: 
    case ComputeContext::DEVICE_MAX_PARAMETER_SIZE:
    case ComputeContext::DEVICE_PROFILING_TIMER_RESOLUTION:
    case ComputeContext::DEVICE_IMAGE2D_MAX_HEIGHT:
    case ComputeContext::DEVICE_IMAGE2D_MAX_WIDTH:
    case ComputeContext::DEVICE_IMAGE3D_MAX_HEIGHT:
    case ComputeContext::DEVICE_IMAGE3D_MAX_DEPTH:
    case ComputeContext::DEVICE_IMAGE3D_MAX_WIDTH: {
        size_t infoValue = 0;
        err = platformObject()->getDeviceInfo(infoType, &infoValue);
        if (err == ComputeContext::SUCCESS)
            return WebCLGetInfo(static_cast<CCuint>(infoValue));
        break;
    }
    case ComputeContext::DEVICE_MAX_WORK_ITEM_DIMENSIONS:
    case ComputeContext::DEVICE_PREFERRED_VECTOR_WIDTH_CHAR:
    case ComputeContext::DEVICE_PREFERRED_VECTOR_WIDTH_SHORT:
    case ComputeContext::DEVICE_PREFERRED_VECTOR_WIDTH_INT:
    case ComputeContext::DEVICE_PREFERRED_VECTOR_WIDTH_LONG:
    case ComputeContext::DEVICE_PREFERRED_VECTOR_WIDTH_FLOAT:
    case ComputeContext::DEVICE_NATIVE_VECTOR_WIDTH_CHAR:
    case ComputeContext::DEVICE_NATIVE_VECTOR_WIDTH_SHORT:
    case ComputeContext::DEVICE_NATIVE_VECTOR_WIDTH_INT:
    case ComputeContext::DEVICE_NATIVE_VECTOR_WIDTH_LONG:
    case ComputeContext::DEVICE_NATIVE_VECTOR_WIDTH_FLOAT:
    case ComputeContext::DEVICE_MAX_CLOCK_FREQUENCY:
    case ComputeContext::DEVICE_MAX_READ_IMAGE_ARGS:
    case ComputeContext::DEVICE_MAX_WRITE_IMAGE_ARGS:
    case ComputeContext::DEVICE_MAX_SAMPLERS:
    case ComputeContext::DEVICE_MEM_BASE_ADDR_ALIGN:
    case ComputeContext::DEVICE_GLOBAL_MEM_CACHELINE_SIZE:
    case ComputeContext::DEVICE_MAX_CONSTANT_ARGS:
    case ComputeContext::DEVICE_ADDRESS_BITS:
    case ComputeContext::DEVICE_MAX_COMPUTE_UNITS: {
        CCuint infoValue = 0;
        err = platformObject()->getDeviceInfo(infoType, &infoValue);
        if (err == ComputeContext::SUCCESS)
            return WebCLGetInfo(static_cast<CCuint>(infoValue));
        break;
    }
    case ComputeContext::DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE:
    case ComputeContext::DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE: {
        if (!isEnabledExtension("KHR_fp64"))
            return WebCLGetInfo(0);
        CCuint infoValue = 0;
        err = platformObject()->getDeviceInfo(infoType, &infoValue);
        if (err == ComputeContext::SUCCESS)
            return WebCLGetInfo(static_cast<CCuint>(infoValue));
        break;
    }
    case ComputeContext::DEVICE_NATIVE_VECTOR_WIDTH_HALF:
    case ComputeContext::DEVICE_PREFERRED_VECTOR_WIDTH_HALF: {
        if (!isEnabledExtension("KHR_fp16"))
            return WebCLGetInfo(0);
        CCuint infoValue = 0;
        err = platformObject()->getDeviceInfo(infoType, &infoValue);
        if (err == ComputeContext::SUCCESS)
            return WebCLGetInfo(static_cast<CCuint>(infoValue));
        break;
    }
    case ComputeContext::DEVICE_LOCAL_MEM_SIZE:
    case ComputeContext::DEVICE_MAX_CONSTANT_BUFFER_SIZE:
    case ComputeContext::DEVICE_GLOBAL_MEM_SIZE:
//.........这里部分代码省略.........
开发者ID:highweb-project,项目名称:qplusweb,代码行数:101,代码来源:WebCLDevice.cpp

示例5: emptyString

String WorkerLocation::search() const
{
    return m_url.query().isEmpty() ? emptyString() : "?" + m_url.query();
}
开发者ID:sanyaade-mobiledev,项目名称:Webkit-Projects,代码行数:4,代码来源:WorkerLocation.cpp

示例6: LOG

void MediaPlaybackTargetPickerMock::invalidatePlaybackTargets()
{
    LOG(Media, "MediaPlaybackTargetPickerMock::invalidatePlaybackTargets");
    setState(emptyString(), MediaPlaybackTargetContext::Unknown);
}
开发者ID:quanmo,项目名称:webkit,代码行数:5,代码来源:MediaPlaybackTargetPickerMock.cpp

示例7: emptyString

String DOMURLUtilsReadOnly::port(const KURL& kurl) {
  if (kurl.hasPort())
    return String::number(kurl.port());

  return emptyString();
}
开发者ID:mirror,项目名称:chromium,代码行数:6,代码来源:DOMURLUtilsReadOnly.cpp

示例8: ASSERT

void SubresourceLoader::didReceiveResponse(const ResourceResponse& response)
{
    ASSERT(!response.isNull());
    ASSERT(m_state == Initialized);

    // We want redirect responses to be processed through willSendRequestInternal. The only exception is redirection with no Location headers.
    ASSERT(response.httpStatusCode() < 300 || response.httpStatusCode() >= 400 || response.httpStatusCode() == 304 || !response.httpHeaderField(HTTPHeaderName::Location));

    // Reference the object in this method since the additional processing can do
    // anything including removing the last reference to this object; one example of this is 3266216.
    Ref<SubresourceLoader> protectedThis(*this);

    if (shouldIncludeCertificateInfo())
        response.includeCertificateInfo();

    if (m_resource->resourceToRevalidate()) {
        if (response.httpStatusCode() == 304) {
            // 304 Not modified / Use local copy
            // Existing resource is ok, just use it updating the expiration time.
            m_resource->setResponse(response);
            MemoryCache::singleton().revalidationSucceeded(*m_resource, response);
            if (m_frame && m_frame->page())
                m_frame->page()->diagnosticLoggingClient().logDiagnosticMessageWithResult(DiagnosticLoggingKeys::cachedResourceRevalidationKey(), emptyString(), DiagnosticLoggingResultPass, ShouldSample::Yes);
            if (!reachedTerminalState())
                ResourceLoader::didReceiveResponse(response);
            return;
        }
        // Did not get 304 response, continue as a regular resource load.
        MemoryCache::singleton().revalidationFailed(*m_resource);
        if (m_frame && m_frame->page())
            m_frame->page()->diagnosticLoggingClient().logDiagnosticMessageWithResult(DiagnosticLoggingKeys::cachedResourceRevalidationKey(), emptyString(), DiagnosticLoggingResultFail, ShouldSample::Yes);
    }

    String errorDescription;
    if (!checkResponseCrossOriginAccessControl(response, errorDescription)) {
        if (m_frame && m_frame->document())
            m_frame->document()->addConsoleMessage(MessageSource::Security, MessageLevel::Error, errorDescription);
        cancel(ResourceError(String(), 0, request().url(), errorDescription, ResourceError::Type::AccessControl));
        return;
    }

    m_resource->responseReceived(response);
    if (reachedTerminalState())
        return;

    ResourceLoader::didReceiveResponse(response);
    if (reachedTerminalState())
        return;

    // FIXME: Main resources have a different set of rules for multipart than images do.
    // Hopefully we can merge those 2 paths.
    if (response.isMultipart() && m_resource->type() != CachedResource::MainResource) {
        m_loadingMultipartContent = true;

        // We don't count multiParts in a CachedResourceLoader's request count
        m_requestCountTracker = Nullopt;
        if (!m_resource->isImage()) {
            cancel();
            return;
        }
    }

    auto* buffer = resourceData();
    if (m_loadingMultipartContent && buffer && buffer->size()) {
        // The resource data will change as the next part is loaded, so we need to make a copy.
        m_resource->finishLoading(buffer->copy().ptr());
        clearResourceData();
        // Since a subresource loader does not load multipart sections progressively, data was delivered to the loader all at once.
        // After the first multipart section is complete, signal to delegates that this load is "finished"
        m_documentLoader->subresourceLoaderFinishedLoadingOnePart(this);
        didFinishLoadingOnePart(0);
    }

    checkForHTTPStatusCodeError();
}
开发者ID:ollie314,项目名称:webkit,代码行数:75,代码来源:SubresourceLoader.cpp

示例9: emptyString

String TextCodecLatin1::decode(const char* bytes, size_t length, FlushBehavior, bool, bool&)
{
    LChar* characters;
    if (!length)
        return emptyString();
    String result = String::createUninitialized(length, characters);

    const uint8_t* source = reinterpret_cast<const uint8_t*>(bytes);
    const uint8_t* end = reinterpret_cast<const uint8_t*>(bytes + length);
    const uint8_t* alignedEnd = alignToMachineWord(end);
    LChar* destination = characters;

    while (source < end) {
        if (isASCII(*source)) {
            // Fast path for ASCII. Most Latin-1 text will be ASCII.
            if (isAlignedToMachineWord(source)) {
                while (source < alignedEnd) {
                    MachineWord chunk = *reinterpret_cast_ptr<const MachineWord*>(source);

                    if (!isAllASCII<LChar>(chunk))
                        goto useLookupTable;

                    copyASCIIMachineWord(destination, source);
                    source += sizeof(MachineWord);
                    destination += sizeof(MachineWord);
                }

                if (source == end)
                    break;
            }
            *destination = *source;
        } else {
useLookupTable:
            if (table[*source] > 0xff)
                goto upConvertTo16Bit;

            *destination = static_cast<LChar>(table[*source]);
        }

        ++source;
        ++destination;
    }

    return result;

upConvertTo16Bit:
    UChar* characters16;
    String result16 = String::createUninitialized(length, characters16);

    UChar* destination16 = characters16;

    // Zero extend and copy already processed 8 bit data
    LChar* ptr8 = characters;
    LChar* endPtr8 = destination;

    while (ptr8 < endPtr8)
        *destination16++ = *ptr8++;

    // Handle the character that triggered the 16 bit path
    *destination16 = table[*source];
    ++source;
    ++destination16;

    while (source < end) {
        if (isASCII(*source)) {
            // Fast path for ASCII. Most Latin-1 text will be ASCII.
            if (isAlignedToMachineWord(source)) {
                while (source < alignedEnd) {
                    MachineWord chunk = *reinterpret_cast_ptr<const MachineWord*>(source);

                    if (!isAllASCII<LChar>(chunk))
                        goto useLookupTable16;

                    copyASCIIMachineWord(destination16, source);
                    source += sizeof(MachineWord);
                    destination16 += sizeof(MachineWord);
                }

                if (source == end)
                    break;
            }
            *destination16 = *source;
        } else {
useLookupTable16:
            *destination16 = table[*source];
        }

        ++source;
        ++destination16;
    }

    return result16;
}
开发者ID:335969568,项目名称:Blink-1,代码行数:93,代码来源:TextCodecLatin1.cpp

示例10: request

void SubresourceLoader::willSendRequestInternal(ResourceRequest& newRequest, const ResourceResponse& redirectResponse)
{
    // Store the previous URL because the call to ResourceLoader::willSendRequest will modify it.
    URL previousURL = request().url();
    Ref<SubresourceLoader> protectedThis(*this);

    if (!newRequest.url().isValid()) {
        cancel(cannotShowURLError());
        return;
    }

    if (newRequest.requester() != ResourceRequestBase::Requester::Main)
        ResourceLoadObserver::sharedObserver().logSubresourceLoading(m_frame.get(), newRequest, redirectResponse);

    ASSERT(!newRequest.isNull());
    if (!redirectResponse.isNull()) {
        if (options().redirect != FetchOptions::Redirect::Follow) {
            if (options().redirect == FetchOptions::Redirect::Error) {
                cancel();
                return;
            }

            ResourceResponse opaqueRedirectedResponse;
            opaqueRedirectedResponse.setURL(redirectResponse.url());
            opaqueRedirectedResponse.setType(ResourceResponse::Type::Opaqueredirect);
            m_resource->responseReceived(opaqueRedirectedResponse);
            didFinishLoading(currentTime());
            return;
        } else if (m_redirectCount++ >= options().maxRedirectCount) {
            cancel(ResourceError(String(), 0, request().url(), ASCIILiteral("Too many redirections"), ResourceError::Type::General));
            return;
        }

        // CachedResources are keyed off their original request URL.
        // Requesting the same original URL a second time can redirect to a unique second resource.
        // Therefore, if a redirect to a different destination URL occurs, we should no longer consider this a revalidation of the first resource.
        // Doing so would have us reusing the resource from the first request if the second request's revalidation succeeds.
        if (newRequest.isConditional() && m_resource->resourceToRevalidate() && newRequest.url() != m_resource->resourceToRevalidate()->response().url()) {
            newRequest.makeUnconditional();
            MemoryCache::singleton().revalidationFailed(*m_resource);
            if (m_frame && m_frame->page())
                m_frame->page()->diagnosticLoggingClient().logDiagnosticMessageWithResult(DiagnosticLoggingKeys::cachedResourceRevalidationKey(), emptyString(), DiagnosticLoggingResultFail, ShouldSample::Yes);
        }

        if (!m_documentLoader->cachedResourceLoader().updateRequestAfterRedirection(m_resource->type(), newRequest, options())) {
            cancel();
            return;
        }

        String errorDescription;
        if (!checkRedirectionCrossOriginAccessControl(request(), redirectResponse, newRequest, errorDescription)) {
            String errorMessage = "Cross-origin redirection to " + newRequest.url().string() + " denied by Cross-Origin Resource Sharing policy: " + errorDescription;
            if (m_frame && m_frame->document())
                m_frame->document()->addConsoleMessage(MessageSource::Security, MessageLevel::Error, errorMessage);
            cancel(ResourceError(String(), 0, request().url(), errorMessage, ResourceError::Type::AccessControl));
            return;
        }

        if (m_resource->isImage() && m_documentLoader->cachedResourceLoader().shouldDeferImageLoad(newRequest.url())) {
            cancel();
            return;
        }
        m_loadTiming.addRedirect(redirectResponse.url(), newRequest.url());
        m_resource->redirectReceived(newRequest, redirectResponse);
    }

    if (newRequest.isNull() || reachedTerminalState())
        return;

    ResourceLoader::willSendRequestInternal(newRequest, redirectResponse);
    if (newRequest.isNull()) {
        cancel();
        return;
    }

    if (m_resource->type() == CachedResource::MainResource && !redirectResponse.isNull())
        m_documentLoader->willContinueMainResourceLoadAfterRedirect(newRequest);
}
开发者ID:ollie314,项目名称:webkit,代码行数:78,代码来源:SubresourceLoader.cpp

示例11: String

String SharedBufferChunkReader::nextChunkAsUTF8StringWithLatin1Fallback(bool includeSeparator)
{
    Vector<char> data;
    if (!nextChunk(data, includeSeparator))
        return String();

    return data.size() ? String::fromUTF8WithLatin1Fallback(data.data(), data.size()) : emptyString();
}
开发者ID:howardroark2018,项目名称:chromium,代码行数:8,代码来源:SharedBufferChunkReader.cpp

示例12: createFragmentFromMarkup

PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame& frame, Range& context, bool allowPlainText, bool& chosePlainText)
{
    if (m_gtkClipboard)
        PasteboardHelper::defaultPasteboardHelper()->getClipboardContents(m_gtkClipboard);

    chosePlainText = false;

    if (m_dataObject->hasMarkup()) {
        if (frame.document()) {
            RefPtr<DocumentFragment> fragment = createFragmentFromMarkup(*frame.document(), m_dataObject->markup(), emptyString(), DisallowScriptingAndPluginContent);
            if (fragment)
                return fragment.release();
        }
    }

    if (!allowPlainText)
        return 0;

    if (m_dataObject->hasText()) {
        chosePlainText = true;
        RefPtr<DocumentFragment> fragment = createFragmentFromText(context, m_dataObject->text());
        if (fragment)
            return fragment.release();
    }

    return 0;
}
开发者ID:MYSHLIFE,项目名称:webkit,代码行数:27,代码来源:PasteboardGtk.cpp

示例13: clCreateProgramWithSource

void WebCLMemoryUtil::ensureMemory(WebCLMemoryObject* memoryObject, WebCLCommandQueue* commandQueue, ExceptionState& es)
{
    cl_int err = CL_SUCCESS;
    // The program and kernels are used to intialize OpenCL memory to 0.
    // Every created OpenCL memory should call this function to intialize.
    // TODO(junmin-zhu): Move intialization from buffer creation to buffer operations, such as: enqueueRead/Write/Copy* and enqueueNDRangeKernel function
    // after the third_party WebCL-validator integrated.
    if (!m_program) {
        cl_program clProgramId = clCreateProgramWithSource(m_context->getContext(), 1, (const char**)&programSource, nullptr, &err);
        if (err != CL_SUCCESS) {
            WebCLException::throwException(err, es);
            return;
        }

        m_program = WebCLProgram::create(clProgramId, m_context, String(programSource));
        m_program->build(m_context->getDevices(), emptyString(), nullptr, es);

        cl_kernel clKernelId16 = clCreateKernel(clProgramId, "init16", &err);
        if (err != CL_SUCCESS) {
            WebCLException::throwException(err, es);
            return;
        }

        m_kernelChar16 = WebCLKernel::create(clKernelId16, m_context, m_program.get(), String("init16"));
        cl_kernel clKernelId = clCreateKernel(clProgramId, "init", &err);
        if (err != CL_SUCCESS) {
            WebCLException::throwException(err, es);
            return;
        }

        m_kernelChar = WebCLKernel::create(clKernelId, m_context, m_program.get(), String("init"));
    }

    unsigned count = memoryObject->sizeInBytes() / 16;
    if (count) {
        m_kernelChar16->setArg(0, memoryObject, es);
        if (es.hadException())
            return;

        m_kernelChar16->setArg(1, sizeof(unsigned), &count, es);
        if (es.hadException())
            return;

        Vector<double> globalWorkSize;
        globalWorkSize.append(count);
        Vector<double> globalWorkOffset;
        Vector<double> localWorkSize;

        commandQueue->enqueueNDRangeKernel(m_kernelChar16.get(), globalWorkSize.size(), globalWorkOffset, globalWorkSize, localWorkSize, Vector<RefPtr<WebCLEvent>>(), nullptr, es);
    }

    unsigned remainingBytes = memoryObject->sizeInBytes() % 16;
    if (remainingBytes) {
        m_kernelChar->setArg(0, memoryObject, es);
        if (es.hadException())
            return;

        unsigned offset = count * 16;
        m_kernelChar->setArg(1, sizeof(unsigned), &offset, es);
        if (es.hadException())
            return;

        unsigned totalSize = memoryObject->sizeInBytes();
        m_kernelChar->setArg(2, sizeof(unsigned), &totalSize, es);
        if (es.hadException())
            return;

        Vector<double> globalWorkSize;
        globalWorkSize.append(remainingBytes);
        Vector<double> globalWorkOffset;
        Vector<double> localWorkSize;

        commandQueue->enqueueNDRangeKernel(m_kernelChar.get(), globalWorkSize.size(), globalWorkOffset, globalWorkSize, localWorkSize, Vector<RefPtr<WebCLEvent>>(), nullptr, es);
    }

    commandQueue->finishCommandQueues(WebCLCommandQueue::SyncMethod::SYNC);
}
开发者ID:joone,项目名称:chromium-crosswalk,代码行数:77,代码来源:WebCLMemoryUtil.cpp

示例14: String

String KURL::stringForInvalidComponent() const
{
    if (m_string.isNull())
        return String();
    return emptyString();
}
开发者ID:shaoboyan,项目名称:chromium-crosswalk,代码行数:6,代码来源:KURL.cpp

示例15: input


//.........这里部分代码省略.........

            // 2. If value does not contain at least one character in the range U+0030 DIGIT ZERO (0) to U+0039 DIGIT 
            //    NINE (9), then jump to the step labeled next setting.
            // 3. If any character in value other than the first character is a U+002D HYPHEN-MINUS character (-), then 
            //    jump to the step labeled next setting.
            // 4. If any character in value other than the last character is a U+0025 PERCENT SIGN character (%), then
            //    jump to the step labeled next setting.
            // 5. If the first character in value is a U+002D HYPHEN-MINUS character (-) and the last character in value is a 
            //    U+0025 PERCENT SIGN character (%), then jump to the step labeled next setting.
            if (!numDigits || (isPercentage && isNegative))
                break;

            // 6. Ignoring the trailing percent sign, if any, interpret value as a (potentially signed) integer, and 
            //    let number be that number. 
            // 7. If the last character in value is a U+0025 PERCENT SIGN character (%), but number is not in the range 
            //    0 ≤ number ≤ 100, then jump to the step labeled next setting.
            // 8. Let cue's text track cue line position be number.
            // 9. If the last character in value is a U+0025 PERCENT SIGN character (%), then let cue's text track cue 
            //    snap-to-lines flag be false. Otherwise, let it be true.
            if (isPercentage) {
                if (linePosition < 0 || linePosition > 100)
                    break;

                // 10 - If '%' then set snap-to-lines flag to false.
                m_snapToLines = false;
            } else {
                if (isNegative)
                    linePosition = -linePosition;

                m_snapToLines = true;
            }

            m_linePosition = linePosition;
            break;
        }
        case Position: {
            int number;
            // Steps 1 - 6.
            if (!scanPercentage(input, valueRun, number))            
                break;

            // 7. Let cue's text track cue text position be number.
            m_textPosition = number;
            break;
        }
        case Size: {
            int number;
            // Steps 1 - 6.
            if (!scanPercentage(input, valueRun, number))            
                break;

            // 7. Let cue's text track cue size be number.
            m_cueSize = number;
            break;
        }
        case Align: {
            // 1. If value is a case-sensitive match for the string "start", then let cue's text track cue alignment be start alignment.
            if (input.scanRun(valueRun, startKeyword()))
                m_cueAlignment = Start;

            // 2. If value is a case-sensitive match for the string "middle", then let cue's text track cue alignment be middle alignment.
            else if (input.scanRun(valueRun, middleKeyword()))
                m_cueAlignment = Middle;

            // 3. If value is a case-sensitive match for the string "end", then let cue's text track cue alignment be end alignment.
            else if (input.scanRun(valueRun, endKeyword()))
                m_cueAlignment = End;

            // 4. If value is a case-sensitive match for the string "left", then let cue's text track cue alignment be left alignment.
            else if (input.scanRun(valueRun, leftKeyword()))
                m_cueAlignment = Left;

            // 5. If value is a case-sensitive match for the string "right", then let cue's text track cue alignment be right alignment.
            else if (input.scanRun(valueRun, rightKeyword()))
                m_cueAlignment = Right;
            break;
        }
#if ENABLE(WEBVTT_REGIONS)
        case RegionId:
            m_regionId = input.extractString(valueRun);
            break;
#endif
        case None:
            break;
        }

        // Make sure the entire run is consumed.
        input.skipRun(valueRun);
    }
#if ENABLE(WEBVTT_REGIONS)
    // If cue's line position is not auto or cue's size is not 100 or cue's
    // writing direction is not horizontal, but cue's region identifier is not
    // the empty string, let cue's region identifier be the empty string.
    if (m_regionId.isEmpty())
        return;

    if (m_linePosition != undefinedPosition || m_cueSize != 100 || m_writingDirection != Horizontal)
        m_regionId = emptyString();
#endif
}
开发者ID:Zirias,项目名称:webkitfltk,代码行数:101,代码来源:VTTCue.cpp


注:本文中的emptyString函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。