Logo Search packages:      
Sourcecode: djvulibre version File versions

void GURL::add_djvu_cgi_argument ( const GUTF8String name,
const char *  value = 0 
)

Appends the specified CGI argument. Will insert "#DJVUOPTS#" if necessary

Definition at line 864 of file GURL.cpp.

References ArrayBase::resize(), and ArrayBase::size().

{
   if(!validurl)
     init();
   GCriticalSectionLock lock1(&class_lock);

      // Check if we already have the "DJVUOPTS" argument
   bool have_djvuopts=false;
   for(int i=0;i<cgi_name_arr.size();i++)
   {
      if (cgi_name_arr[i].upcase()==djvuopts)
      {
         have_djvuopts=true;
         break;
      }
   }

      // If there is no DJVUOPTS, insert it
   if (!have_djvuopts)
   {
      int pos=cgi_name_arr.size();
      cgi_name_arr.resize(pos);
      cgi_value_arr.resize(pos);
      cgi_name_arr[pos]=djvuopts;
   }

      // Add new argument to the array
   int pos=cgi_name_arr.size();
   cgi_name_arr.resize(pos);
   cgi_value_arr.resize(pos);
   cgi_name_arr[pos]=name;
   cgi_value_arr[pos]=value;

      // And update the URL
   store_cgi_args();
}


Generated by  Doxygen 1.6.0   Back to index