Example #1
0
void XStr::line_append_padding(const char c, int lineWidth)
{
    XStr xs;
    int count = 0;

    for(unsigned int i=0; i<len; i++) {
        if(s[i] == '\n') {
            // found line ending
            while(count++ < lineWidth-1)
                xs << " ";
            xs << c << "\n";
            count=0;
        } else if(s[i] == '\t') {
            // found tab, convert to 2 spaces
            xs << "  ";
            count+=2;
        } else {
            // found non-line ending
            xs << s[i];
            count++;
        }
    }
    delete[] s;
    initTo(xs.charstar());
}
Example #2
0
 XMLCh *
 Basic_Resolver::operator() (const XMLCh *const,
                             const XMLCh *const systemId) const
 {
   XStr path (path_);
   path.append (systemId);
   return path.release ();
 }
Example #3
0
    InputSource *
    Basic_Resolver <CHAR>::operator() (const XMLCh *const publicId,
                                       const XMLCh *const systemId) const
    {
      XStr path (path_);
      path.append (systemId);

      return new xercesc::LocalFileInputSource (path);
    }
Example #4
0
void XStr::line_append(const char c)
{
    XStr xs;
    for(unsigned int i=0; i<len; i++) {
        if(s[i] == '\n')
            xs << c << "\n";
        else
            xs << s[i];
    }
    delete[] s;
    initTo(xs.charstar());
}
Example #5
0
  void
  Environment_Resolver::add_path (const ACE_TCHAR *variable,
                                  const ACE_TCHAR *relpath)
  {
    ACE_Env_Value <const ACE_TCHAR *> path_env (variable,
                                                ACE_TEXT(""));

    XStr xpath (path_env);
    XStr xrelpath (relpath);

    xpath.append (xrelpath);

    paths_.push_back (xpath);
  }
Example #6
0
      bool operator () (T item)
      {
        if (item.empty ())
          return false;

        XStr path (item.c_str ());
        path.append (this->systemId_);

        FileHandle file (XMLPlatformUtils::openFile (path));
        bool retval = 0 != file ? true : false;

        if (retval)
          XMLPlatformUtils::closeFile (file);

        return retval;
      }
Example #7
0
void CEntry::check()
{
  if (decl_entry == NULL) {
    XStr str;
    paramlist->printTypes(str);
    std::string msg = "no matching declaration for entry method \'" +
      std::string(entry->get_string_const()) +
      "(" + std::string(str.get_string_const()) + ")\'";
    XLAT_ERROR_NOCOL(msg, first_line_);

    std::list<Entry*> clist = getCandidates();
    if (!clist.empty())
      for (std::list<Entry*>::iterator it = clist.begin(); it != clist.end(); ++it)
        XLAT_NOTE("candidate method not viable: type signatures must match exactly",
                  (*it)->first_line_);
  }
}
Example #8
0
    InputSource *
    Path_Resolver <CHAR>::operator() (const XMLCh *const,
                                      const XMLCh *const systemId) const
    {
      typename path_type::const_iterator iter =
        std::find_if (this->paths_.begin (),
                      this->paths_.end (),
                      Path_Resolver_Functor (systemId));

      if (iter != this->paths_.end ())
      {
        XStr path (iter->c_str ());
        path.append (systemId);
        return new xercesc::LocalFileInputSource (path);
      }

      return 0;
    }
Example #9
0
  XMLCh *
  Environment_Resolver::operator() (const XMLCh *const,
                                    const XMLCh *const systemId) const
  {
    for (std::vector<XStr>::const_iterator i = this->paths_.begin ();
          i != this->paths_.end ();
          ++i)
      {
        XStr path (*i);
        path.append(systemId);

        FileHandle file (XMLPlatformUtils::openFile (path));

        if (file != 0)
          {
            XMLPlatformUtils::closeFile (file);
            return path.release ();
          }
      }
    return 0;
  }
Example #10
0
XStr::XStr(const XStr &_s) {
    initTo(_s.get_string_const());
}