Package com.caucho.quercus.env

Examples of com.caucho.quercus.env.StringValue


        //
        // env.setGlobalValue("request", env.wrapJava(request));
        // env.setGlobalValue("response", env.wrapJava(response));
        // env.setGlobalValue("servletContext", env.wrapJava(_servletContext));

        StringValue prepend
          = quercus.getIniValue("auto_prepend_file").toStringValue(env);
        if (prepend.length() > 0) {
          Path prependPath = env.lookup(prepend);
         
          if (prependPath == null)
            env.error(L.l("auto_prepend_file '{0}' not found.", prepend));
          else {
            QuercusPage prependPage = getQuercus().parse(prependPath);
            prependPage.executeTop(env);
          }
        }

        env.executeTop();

        StringValue append
          = quercus.getIniValue("auto_append_file").toStringValue(env);
        if (append.length() > 0) {
          Path appendPath = env.lookup(append);
         
          if (appendPath == null)
            env.error(L.l("auto_append_file '{0}' not found.", append));
          else {
View Full Code Here


   * Creates a string.  Because these strings are typically Java
   * constants, they fit into a lru cache.
   */
  public StringValue createString(String name)
  {
    StringValue value = _stringMap.get(name);

    if (value == null) {
      value = new ConstStringValue(name);

      _stringMap.put(name, value);
View Full Code Here

    throws IOException
  {
    _in = path.openRead();
    _peekChar = -1;

    StringValue metadata = getMetadata();

    _pluralExpr = PluralExpr.getPluralExpr(metadata);
    _charset = getCharset(metadata);

    _in.setEncoding(_charset);
View Full Code Here

  }

  private StringValue getMetadata()
    throws IOException
  {
    StringValue metadata = null;

    int token = readToken();

    while (token >= 0 && token != UNKNOWN) {
      if (token == MSGID && _string.length() == 0) {
View Full Code Here

    while (token >= 0) {
      if (token != MSGID)
        return null;

      StringValue msgid = _string;

      token = readToken();
      if (token == MSGID_PLURAL)
        token = readToken();
View Full Code Here

    _offsetTranslation = readInt();

    if (_numberOfStrings < 0 || _offsetOriginal < 0 || _offsetTranslation < 0)
      return;

    StringValue metadata = getMetadata();
    _pluralExpr = PluralExpr.getPluralExpr(metadata);
    _charset = getCharset(metadata);
  }
View Full Code Here

   * Reads in a string until NULL or EOF encountered.
   */
  private StringValue readOriginalString()
    throws IOException
  {
    StringValue sb = new UnicodeBuilderValue();

    for (int ch = _in.readChar(); ch > 0; ch = _in.readChar()) {
      sb.append((char)ch);
    }

    return sb;
  }
View Full Code Here

   */
  private ArrayList<StringValue> readPluralForms(int length)
    throws IOException
  {
    ArrayList<StringValue> list = new ArrayList<StringValue>();
    StringValue sb = new UnicodeBuilderValue();

    for (; length > 0; length--) {
      int ch = _in.readChar();

      if (ch > 0)
        sb.append((char)ch);

      else if (ch == 0) {
        list.add(sb);
        sb = new UnicodeBuilderValue();
      }
View Full Code Here

  }

  private StringValue readInternalBlob(Env env, long length)
  {
    try {
      StringValue bb = env.createBinaryBuilder();

      Blob blob = (Blob) _lob;
      InputStream is = blob.getBinaryStream();
      is.skip(_currentPointer);

      if (length < 0)
        length = Integer.MAX_VALUE;
     
      bb.appendReadAll(is, length);

      is.close();

      return bb;
    } catch (Exception ex) {
View Full Code Here

  private StringValue readInternalClob(Env env,
                                       long length)
  {
    try {
      StringValue sb = env.createUnicodeBuilder();

      Clob clob = (Clob) _lob;
      Reader reader = clob.getCharacterStream();
      reader.skip(_currentPointer);

      if (length < 0)
        length = Integer.MAX_VALUE;

      sb.append(reader, length);

      reader.close();

      return sb;
    } catch (Exception ex) {
View Full Code Here

TOP

Related Classes of com.caucho.quercus.env.StringValue

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.