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


PHP _hx_char_code_at函数代码示例

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


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

示例1: escapeArgument

 static function escapeArgument($arg)
 {
     $ok = true;
     $_g1 = 0;
     $_g = strlen($arg);
     while ($_g1 < $_g) {
         $i = $_g1++;
         switch (_hx_char_code_at($arg, $i)) {
             case 32:
             case 34:
                 $ok = false;
                 break;
             case 0:
             case 13:
             case 10:
                 $arg = _hx_substr($arg, 0, $i);
                 break;
         }
         unset($i);
     }
     if ($ok) {
         return $arg;
     }
     return "\"" . _hx_explode("\"", $arg)->join("\\\"") . "\"";
 }
开发者ID:marcdraco,项目名称:Webrathea,代码行数:25,代码来源:Sys.class.php

示例2: nextSafeToken

 public function nextSafeToken()
 {
     if ($this->i < $this->n) {
         $this->c = _hx_char_code_at($this->str, $this->i);
         $this->i++;
     } else {
         $this->c = -1;
     }
 }
开发者ID:arip33,项目名称:simlibrary,代码行数:9,代码来源:StringParser.class.php

示例3: log

 public function log($context, $appMessages)
 {
     $logFile = _hx_string_or_null($context->get_contentDirectory()) . _hx_string_or_null($this->path);
     $req = $context->request;
     $res = $context->response;
     $userDetails = $req->get_clientIP();
     if ((null !== $context->session ? $context->session->get_id() : null) !== null) {
         $userDetails .= " " . _hx_string_or_null(null !== $context->session ? $context->session->get_id() : null);
     }
     if (($context->auth !== null && $context->auth->get_currentUser() !== null ? $context->auth->get_currentUser()->get_userID() : null) !== null) {
         $userDetails .= " " . _hx_string_or_null($context->auth !== null && $context->auth->get_currentUser() !== null ? $context->auth->get_currentUser()->get_userID() : null);
     }
     $content = "" . Std::string(Date::now()) . " [" . _hx_string_or_null($req->get_httpMethod()) . "] [" . _hx_string_or_null($req->get_uri()) . "] from [" . _hx_string_or_null($userDetails) . "], response: [" . _hx_string_rec($res->status, "") . " " . _hx_string_or_null($res->get_contentType()) . "]\n";
     $_g = 0;
     $_g1 = $context->messages;
     while ($_g < $_g1->length) {
         $msg = $_g1[$_g];
         ++$_g;
         $content .= "\t" . _hx_string_or_null(ufront_log_FileLogger::format($msg)) . "\n";
         unset($msg);
     }
     if ($appMessages !== null) {
         $_g2 = 0;
         while ($_g2 < $appMessages->length) {
             $msg1 = $appMessages[$_g2];
             ++$_g2;
             $content .= "\t" . _hx_string_or_null(ufront_log_FileLogger::format($msg1)) . "\n";
             unset($msg1);
         }
     }
     $path = haxe_io_Path::directory($logFile);
     $path1 = haxe_io_Path::addTrailingSlash($path);
     $_p = null;
     $parts = new _hx_array(array());
     while ($path1 !== ($_p = haxe_io_Path::directory($path1))) {
         $parts->unshift($path1);
         $path1 = $_p;
     }
     $_g3 = 0;
     while ($_g3 < $parts->length) {
         $part = $parts[$_g3];
         ++$_g3;
         if (_hx_char_code_at($part, strlen($part) - 1) !== 58 && !file_exists($part)) {
             @mkdir($part, 493);
         }
         unset($part);
     }
     $file = sys_io_File::append(_hx_string_or_null($context->get_contentDirectory()) . _hx_string_or_null($this->path), null);
     $file->writeString($content);
     $file->close();
     return ufront_core_SurpriseTools::success();
 }
开发者ID:kevinresol,项目名称:mvc-platform-test,代码行数:52,代码来源:FileLogger.class.php

示例4: do_hash

 static function do_hash($s)
 {
     $b = 378551;
     $a = 63689;
     $hash = 0;
     $i = 0;
     $_g1 = 0;
     $_g = strlen($s);
     while ($_g1 < $_g) {
         $i1 = $_g1++;
         $hash = $hash * $a + _hx_char_code_at($s, $i1);
         $a = $a * $b;
         unset($i1);
     }
     return Math::abs($hash);
 }
开发者ID:marcdraco,项目名称:Webrathea,代码行数:16,代码来源:Hashes.class.php

示例5: escapeArgument

 static function escapeArgument($arg)
 {
     $ok = true;
     $_g1 = 0;
     $_g = strlen($arg);
     while ($_g1 < $_g) {
         $i = $_g1++;
         $_g2 = _hx_char_code_at($arg, $i);
         if ($_g2 !== null) {
             switch ($_g2) {
                 case 32:
                 case 9:
                 case 34:
                 case 38:
                 case 124:
                 case 60:
                 case 62:
                 case 35:
                 case 59:
                 case 42:
                 case 63:
                 case 40:
                 case 41:
                 case 123:
                 case 125:
                 case 36:
                     $ok = false;
                     break;
                 case 0:
                 case 13:
                 case 10:
                     $arg = _hx_substr($arg, 0, $i);
                     break;
             }
         }
         unset($i, $_g2);
     }
     if ($ok) {
         return $arg;
     }
     return "\"" . _hx_string_or_null(_hx_explode("\"", _hx_explode("\\", $arg)->join("\\\\"))->join("\\\"")) . "\"";
 }
开发者ID:paulfitz,项目名称:daff-php,代码行数:42,代码来源:Sys.class.php

示例6: quoteForDiff

 static function quoteForDiff($v, $d)
 {
     $nil = "NULL";
     $str = $v->toString($d);
     $score = 0;
     $_g1 = 0;
     $_g = strlen($str);
     while ($_g1 < $_g) {
         $i = $_g1++;
         if (_hx_char_code_at($str, $score) !== 95) {
             break;
         }
         $score++;
         unset($i);
     }
     if (_hx_substr($str, $score, null) === $nil) {
         $str = "_" . _hx_string_or_null($str);
     }
     return $str;
 }
开发者ID:sp-ruben-simon,项目名称:daff-php,代码行数:20,代码来源:FlatCellBuilder.class.php

示例7: isInteger

 static function isInteger($str)
 {
     $str = trim($str);
     $i = 0;
     $n = strlen($str);
     if (StringTools::startsWith($str, "-")) {
         $i++;
     }
     if (StringTools::startsWith($str, "+")) {
         $i++;
     }
     $c = null;
     while ($i < $n) {
         $c = _hx_char_code_at($str, $i);
         if ($c < 48 || $c > 57) {
             return false;
         }
         $i++;
     }
     return true;
 }
开发者ID:arip33,项目名称:simlibrary,代码行数:21,代码来源:WInteger.class.php

示例8: toHex

 public function toHex()
 {
     $s = new StringBuf();
     $chars = new _hx_array(array());
     $str = "0123456789abcdef";
     $_g1 = 0;
     $_g = strlen($str);
     while ($_g1 < $_g) {
         $i = $_g1++;
         $chars->push(_hx_char_code_at($str, $i));
         unset($i);
     }
     $_g1 = 0;
     $_g = $this->length;
     while ($_g1 < $_g) {
         $i = $_g1++;
         $c = ord($this->b[$i]);
         $s->b .= chr($chars[$c >> 4]);
         $s->b .= chr($chars[$c & 15]);
         unset($i, $c);
     }
     return $s->b;
 }
开发者ID:Raniratna,项目名称:new_elearning,代码行数:23,代码来源:Bytes.class.php

示例9: requestIn

 public function requestIn($ctx)
 {
     $_g = $this;
     if (strtolower($ctx->request->get_httpMethod()) === "post" && $ctx->request->isMultipart()) {
         $file = null;
         $postName = null;
         $origFileName = null;
         $size = 0;
         $tmpFilePath = null;
         $dateStr = DateTools::format(Date::now(), "%Y%m%d-%H%M");
         $dir = _hx_string_or_null($ctx->get_contentDirectory()) . _hx_string_or_null(haxe_io_Path::addTrailingSlash(ufront_web_upload_TmpFileUploadMiddleware::$subDir));
         $path = haxe_io_Path::removeTrailingSlashes($dir);
         $path1 = haxe_io_Path::addTrailingSlash($path);
         $_p = null;
         $parts = new _hx_array(array());
         while ($path1 !== ($_p = haxe_io_Path::directory($path1))) {
             $parts->unshift($path1);
             $path1 = $_p;
         }
         $_g1 = 0;
         while ($_g1 < $parts->length) {
             $part = $parts[$_g1];
             ++$_g1;
             if (_hx_char_code_at($part, strlen($part) - 1) !== 58 && !file_exists($part)) {
                 @mkdir($part, 493);
             }
             unset($part);
         }
         $onPart = array(new _hx_lambda(array(&$_g, &$ctx, &$dateStr, &$dir, &$file, &$origFileName, &$postName, &$size, &$tmpFilePath), "ufront_web_upload_TmpFileUploadMiddleware_0"), 'execute');
         $onData = array(new _hx_lambda(array(&$_g, &$ctx, &$dateStr, &$dir, &$file, &$onPart, &$origFileName, &$postName, &$size, &$tmpFilePath), "ufront_web_upload_TmpFileUploadMiddleware_1"), 'execute');
         $onEndPart = array(new _hx_lambda(array(&$_g, &$ctx, &$dateStr, &$dir, &$file, &$onData, &$onPart, &$origFileName, &$postName, &$size, &$tmpFilePath), "ufront_web_upload_TmpFileUploadMiddleware_2"), 'execute');
         return tink_core__Future_Future_Impl_::map($ctx->request->parseMultipart($onPart, $onData, $onEndPart), array(new _hx_lambda(array(&$_g, &$ctx, &$dateStr, &$dir, &$file, &$onData, &$onEndPart, &$onPart, &$origFileName, &$postName, &$size, &$tmpFilePath), "ufront_web_upload_TmpFileUploadMiddleware_3"), 'execute'), null);
     } else {
         return ufront_core_SurpriseTools::success();
     }
 }
开发者ID:kevinresol,项目名称:mvc-platform-test,代码行数:36,代码来源:TmpFileUploadMiddleware.class.php

示例10: fromString

 public function fromString($txt)
 {
     $txt .= "]";
     $at = 0;
     $_g1 = 0;
     $_g = strlen($txt);
     while ($_g1 < $_g) {
         $i = $_g1++;
         $ch = _hx_char_code_at($txt, $i);
         if ($ch >= 48 && $ch <= 57) {
             $at *= 10;
             $at += $ch - 48;
         } else {
             if ($ch === 45) {
                 $at = -1;
             } else {
                 if ($ch === 124) {
                     $this->p = $at;
                     $at = 0;
                 } else {
                     if ($ch === 58) {
                         $this->l = $at;
                         $at = 0;
                     } else {
                         if ($ch === 93) {
                             $this->r = $at;
                             return true;
                         }
                     }
                 }
             }
         }
         unset($i, $ch);
     }
     return false;
 }
开发者ID:paulfitz,项目名称:daff-php,代码行数:36,代码来源:Unit.class.php

示例11: isOp

 static function isOp($c)
 {
     return com_wiris_util_xml_WCharacterBase::isLarge($c) || com_wiris_util_xml_WCharacterBase::isVeryLarge($c) || com_wiris_util_xml_WCharacterBase::isBinaryOp($c) || com_wiris_util_xml_WCharacterBase::isRelation($c) || $c === _hx_char_code_at(".", 0) || $c === _hx_char_code_at(",", 0) || $c === _hx_char_code_at(":", 0);
 }
开发者ID:komcdo,项目名称:winnow,代码行数:4,代码来源:WCharacterBase.class.php

示例12: readLine

 public function readLine()
 {
     $buf = new StringBuf();
     $last = null;
     $s = null;
     try {
         while (($last = $this->readByte()) !== 10) {
             $buf->b .= chr($last);
         }
         $s = $buf->b;
         if (_hx_char_code_at($s, strlen($s) - 1) === 13) {
             $s = _hx_substr($s, 0, -1);
         }
     } catch (Exception $»e) {
         $_ex_ = $»e instanceof HException ? $»e->e : $»e;
         if (($e = $_ex_) instanceof haxe_io_Eof) {
             $s = $buf->b;
             if (strlen($s) === 0) {
                 throw new HException($e);
             }
         } else {
             throw $»e;
         }
     }
     return $s;
 }
开发者ID:ralcr,项目名称:Apple-s-Dictionary-App-database-generator,代码行数:26,代码来源:Input.class.php

示例13: encodeString

 public function encodeString($sb, $s)
 {
     $sb->add("\"");
     $i = null;
     $_g1 = 0;
     $_g = strlen($s);
     while ($_g1 < $_g) {
         $i1 = $_g1++;
         $c = _hx_char_code_at($s, $i1);
         if ($c === 34) {
             $sb->add("\\\"");
         } else {
             if ($c === 13) {
                 $sb->add("\\r");
             } else {
                 if ($c === 10) {
                     $sb->add("\\n");
                 } else {
                     if ($c === 9) {
                         $sb->add("\\t");
                     } else {
                         if ($c === 92) {
                             $sb->add("\\\\");
                         } else {
                             $sb->add(_hx_char_at($s, $i1));
                         }
                     }
                 }
             }
         }
         unset($i1, $c);
     }
     $sb->add("\"");
 }
开发者ID:komcdo,项目名称:winnow,代码行数:34,代码来源:JSon.class.php

示例14: makeConst

 public function makeConst($v)
 {
     haxe_Template::$expr_trim->match($v);
     $v = haxe_Template::$expr_trim->matched(1);
     if (_hx_char_code_at($v, 0) === 34) {
         $str = _hx_substr($v, 1, strlen($v) - 2);
         return array(new _hx_lambda(array("str" => &$str, "v" => &$v), null, array(), "{\n\t\t\t\treturn \$str;\n\t\t\t}"), 'execute0');
     }
     if (haxe_Template::$expr_int->match($v)) {
         $i = Std::parseInt($v);
         return array(new _hx_lambda(array("i" => &$i, "str" => &$str, "v" => &$v), null, array(), "{\n\t\t\t\treturn \$i;\n\t\t\t}"), 'execute0');
     }
     if (haxe_Template::$expr_float->match($v)) {
         $f = Std::parseFloat($v);
         return array(new _hx_lambda(array("f" => &$f, "i" => &$i, "str" => &$str, "v" => &$v), null, array(), "{\n\t\t\t\treturn \$f;\n\t\t\t}"), 'execute0');
     }
     $me = $this;
     return array(new _hx_lambda(array("f" => &$f, "i" => &$i, "me" => &$me, "str" => &$str, "v" => &$v), null, array(), "{\n\t\t\treturn \$me->resolve(\$v);\n\t\t}"), 'execute0');
 }
开发者ID:ralcr,项目名称:Apple-s-Dictionary-App-database-generator,代码行数:19,代码来源:Template.class.php

示例15: applyHeader

 public function applyHeader()
 {
     $_g1 = $this->payloadCol;
     $_g = $this->payloadTop;
     while ($_g1 < $_g) {
         $i = $_g1++;
         $name = $this->getString($i);
         if ($name === "...") {
             $this->modifier->set($i, "...");
             $this->haveDroppedColumns = true;
             continue;
         }
         $mod = $this->modifier->get($i);
         $move = false;
         if ($mod !== null) {
             if (_hx_char_code_at($mod, 0) === 58) {
                 $move = true;
                 $mod = _hx_substr($mod, 1, strlen($mod));
             }
         }
         $this->header->set($i, $name);
         if ($mod !== null) {
             if (_hx_char_code_at($mod, 0) === 40) {
                 $prev_name = _hx_substr($mod, 1, strlen($mod) - 2);
                 $this->headerPre->set($prev_name, $i);
                 $this->headerPost->set($name, $i);
                 $this->headerRename->set($prev_name, $name);
                 continue;
                 unset($prev_name);
             }
         }
         if ($mod !== "+++") {
             $this->headerPre->set($name, $i);
         }
         if ($mod !== "---") {
             $this->headerPost->set($name, $i);
         }
         if ($move) {
             if ($this->headerMove === null) {
                 $this->headerMove = new haxe_ds_StringMap();
             }
             $this->headerMove->set($name, 1);
         }
         unset($name, $move, $mod, $i);
     }
     if (!$this->useMetaForRowChanges()) {
         if ($this->source->get_height() === 0) {
             $this->applyAction("+++");
         }
     }
 }
开发者ID:paulfitz,项目名称:daff-php,代码行数:51,代码来源:HighlightPatch.class.php


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