CMS 3D CMS Logo

Classes | Functions | Variables

/data/refman/pasoursint/CMSSW_5_3_10/src/Fireworks/Core/src/CmsShowSearchFiles.cc File Reference

#include <stdexcept>
#include <iostream>
#include <fstream>
#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 "TSystem.h"
#include "TVirtualX.h"
#include "TPRegexp.h"
#include "Fireworks/Core/interface/CmsShowSearchFiles.h"
#include "Fireworks/Core/interface/fwLog.h"
#include "Fireworks/Core/interface/fwPaths.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_httpPrefix ("http:")
static const std::string s_rootPostfix (".root")

Variables

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

Function Documentation

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

Definition at line 247 of file CmsShowSearchFiles.cc.

References lumiQueryAPI::msg, alignCSCRings::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("http://"))
      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_httpPrefix ( "http:"  ) [static]
static const std::string s_rootPostfix ( ".root"  ) [static]

Variable Documentation

const unsigned int s_columns = 3 [static]

Definition at line 40 of file CmsShowSearchFiles.cc.

Referenced by CmsShowSearchFiles::showPrefixes().

const char* const s_prefixes[][s_columns] [static]
Initial value:
{ 
  {"http://", "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 41 of file CmsShowSearchFiles.cc.

Referenced by CmsShowSearchFiles::showPrefixes().