예제 #1
0
파일: KURL.cpp 프로젝트: ollie314/chromium
bool isValidProtocol(const String& protocol) {
  // RFC3986: ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
  if (protocol.isEmpty())
    return false;
  if (!isSchemeFirstChar(protocol[0]))
    return false;
  unsigned protocolLength = protocol.length();
  for (unsigned i = 1; i < protocolLength; i++) {
    if (!isSchemeChar(protocol[i]))
      return false;
  }
  return true;
}
예제 #2
0
파일: KURL.cpp 프로젝트: 335969568/Blink-1
static bool isSchemeChar(char c)
{
    return isSchemeFirstChar(c) || (c >= '0' && c <= '9') || c == '.' || c == '-' || c == '+';
}