CMS 3D CMS Logo

Classes | Functions | Variables

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/Fireworks/Core/src/CmsShowSearchFiles.cc File Reference

#include <stdexcept>
#include <iostream>
#include <stdlib.h>
#include <set>
#include "TGClient.h"
#include "TGHtml.h"
#include "TGButton.h"
#include "TGMenu.h"
#include "TGLabel.h"
#include "TGTextEntry.h"
#include "TPluginManager.h"
#include "TUrl.h"
#include "TSocket.h"
#include "TVirtualX.h"
#include "Fireworks/Core/interface/CmsShowSearchFiles.h"

Go to the source code of this file.

Classes

class  FWHtml

Functions

static std::string readRemote (const char *url)
static const std::string s_filePrefix ("file:")
static const std::string s_httpsPrefix ("https:")
static const std::string s_rootPostfix (".root")

Variables

static const unsigned int s_columns = 3
static const char * s_noBrowserMessage []
static const char *const s_prefixes [][s_columns]
static const char * s_readError []

Function Documentation

static std::string readRemote ( const char *  url) [static]

Definition at line 222 of file CmsShowSearchFiles.cc.

References runTheMatrix::msg, asciidump::s, and findQualityFiles::size.

Referenced by CmsShowSearchFiles::sendToWebBrowser().

{
   // Read (open) remote files.
   
   char *buf = 0;
   TUrl fUrl(url);
   
   TString msg = "GET ";
   msg += fUrl.GetProtocol();
   msg += "://";
   msg += fUrl.GetHost();
   msg += ":";
   msg += fUrl.GetPort();
   msg += "/";
   msg += fUrl.GetFile();
   msg += "\r\n";
   
   TString uri(url);
   if (!uri.BeginsWith("https://"))
      return std::string();
   TSocket s(fUrl.GetHost(), fUrl.GetPort());
   if (!s.IsValid())
      return std::string();
   if (s.SendRaw(msg.Data(), msg.Length()) == -1)
      return std::string();
   Int_t size = 1024*1024;
   buf = (char *)calloc(size, sizeof(char));
   if (s.RecvRaw(buf, size) == -1) {
      free(buf);
      return std::string();
   }
   std::string returnValue(buf);
   free(buf);
   return returnValue;
}
static const std::string s_filePrefix ( "file:"  ) [static]
static const std::string s_httpsPrefix ( "https:"  ) [static]
static const std::string s_rootPostfix ( ".root"  ) [static]

Variable Documentation

const unsigned int s_columns = 3 [static]

Definition at line 36 of file CmsShowSearchFiles.cc.

Referenced by CmsShowSearchFiles::showPrefixes().

const char* s_noBrowserMessage[] [static]
Initial value:
 {
   "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"https://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd\"> ",
   "<HTML><HEAD><TITLE>No Browser Available</TITLE> ",
   "<META https-equiv=Content-Type content=\"text/html; charset=UTF-8\"></HEAD> ",
   "<BODY> ",
   
   
   "<b>Welcome....</b><BR>",
   "<BR>",
   "<b>You may look at examples:</b><BR>",
   "If you are in Europe, open example data files at CERN: <a href=https://fireworks.web.cern.ch/fireworks/>https://fireworks.web.cern.ch/fireworks/</a><BR>",
   "If you are in US, open example data files at UCSD: <a href=https://uaf-2.t2.ucsd.edu/fireworks/>https://uaf-2.t2.ucsd.edu/fireworks/</a><BR>",
   "<BR>"
   "<b>You also may load files with Choose Prefix </b><BR>"
   "</BODY></HTML> ",
   0
}

Definition at line 52 of file CmsShowSearchFiles.cc.

Referenced by CmsShowSearchFiles::sendToWebBrowser().

const char* const s_prefixes[][s_columns] [static]
Initial value:
{ 
  {"https://fireworks.web.cern.ch/fireworks/","Pre-selected example files at CERN","t"},
  {"https://uaf-2.t2.ucsd.edu/fireworks/","Pre-selected example files in USA","t"},
  {"https://", "Web site known by you",0},
  {"file:","Local file [you must type full path name]",0},
  {"dcap://","dCache [FNAL]",0},
  {"rfio://","Castor [CERN]",0}
  
}

Definition at line 37 of file CmsShowSearchFiles.cc.

Referenced by CmsShowSearchFiles::showPrefixes().

const char* s_readError[] [static]
Initial value:
 {
   "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"https://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd\"> ",
   "<HTML><HEAD><TITLE>HTTP Read Error</TITLE> ",
   "<META https-equiv=Content-Type content=\"text/html; charset=UTF-8\"></HEAD> ",
   "<BODY> ",
   "<P>Unknown error while trying to get file via https</P>",
   "</BODY></HTML> ",
   0
}

Definition at line 70 of file CmsShowSearchFiles.cc.

Referenced by CmsShowSearchFiles::sendToWebBrowser().