コード例 #1
0
void TestUnescapeHelper(const char* in, const char* expected)
{
  nsCString out, strIn(in), strExp(expected);
  nsUrlClassifierUtils utils;
  
  NS_UnescapeURL(strIn.get(), strIn.Length(), esc_AlwaysCopy, out);
  CheckEquals(strExp, out);
}
コード例 #2
0
void TestCanonicalizeHelper(const char* in, const char* expected)
{
  nsCString out, strIn(in), strExp(expected);
  nsUrlClassifierUtils utils;

  utils.CanonicalizePath(strIn, out);
  CheckEquals(strExp, out);
}
コード例 #3
0
void TestEncodeHelper(const char* in, const char* expected)
{
  nsCString out, strIn(in), strExp(expected);
  nsUrlClassifierUtils utils;

  utils.SpecialEncode(strIn, true, out);
  CheckEquals(strExp, out);
}
コード例 #4
0
void TestParseIPAddressHelper(const char *in, const char *expected)
{
  nsCString out, strIn(in), strExp(expected);
  nsUrlClassifierUtils utils;
  utils.Init();

  utils.ParseIPAddress(strIn, out);
  CheckEquals(strExp, out);
}
コード例 #5
0
void TestCanonicalNumHelper(const char *in, PRUint32 bytes,
                            bool allowOctal, const char *expected)
{
  nsCString out, strIn(in), strExp(expected);
  nsUrlClassifierUtils utils;
  utils.Init();

  utils.CanonicalNum(strIn, bytes, allowOctal, out);
  CheckEquals(strExp, out);
}
コード例 #6
0
ファイル: ipparser.cpp プロジェクト: vonway/TeamTalk
//--> check ip is not null and in the right format (xxx.xxx.xxx.xxx)
//--> no idea how it check whether ip is telecom or not 
bool IpParser::isTelcome(const char *pIp)
{
    if(!pIp)
    {
        return false;
    }
    CStrExplode strExp((char*)pIp,'.');
    if(strExp.GetItemCnt() != 4)
    {
        return false;
    }
    return true;
}