CMS 3D CMS Logo

Classes | Functions | Variables
CmsShowSearchFiles.cc File Reference
#include <stdexcept>
#include <iostream>
#include <fstream>
#include <cstdlib>
#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

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

Function Documentation

◆ readRemote()

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

Definition at line 195 of file CmsShowSearchFiles.cc.

195  {
196  // Read (open) remote files.
197 
198  char* buf = nullptr;
199  TUrl fUrl(url);
200 
201  TString msg = "GET ";
202  msg += fUrl.GetProtocol();
203  msg += "://";
204  msg += fUrl.GetHost();
205  msg += ":";
206  msg += fUrl.GetPort();
207  msg += "/";
208  msg += fUrl.GetFile();
209  msg += "\r\n";
210 
211  TString uri(url);
212  if (!uri.BeginsWith("http://"))
213  return std::string();
214  TSocket s(fUrl.GetHost(), fUrl.GetPort());
215  if (!s.IsValid())
216  return std::string();
217  if (s.SendRaw(msg.Data(), msg.Length()) == -1)
218  return std::string();
219  Int_t size = 1024 * 1024;
220  buf = (char*)calloc(size, sizeof(char));
221  if (s.RecvRaw(buf, size) == -1) {
222  free(buf);
223  return std::string();
224  }
225  std::string returnValue(buf);
226  free(buf);
227  return returnValue;
228 }

References visDQMUpload::buf, mps_check::msg, alignCSCRings::s, findQualityFiles::size, AlCaHLTBitMon_QueryRunRegistry::string, and relmon_authenticated_wget::url.

Referenced by CmsShowSearchFiles::sendToWebBrowser().

◆ s_filePrefix()

static const std::string s_filePrefix ( "file:"  )
static

◆ s_httpPrefix()

static const std::string s_httpPrefix ( "http:"  )
static

◆ s_rootPostfix()

static const std::string s_rootPostfix ( ".root"  )
static

Variable Documentation

◆ s_columns

const static unsigned int s_columns = 3
static

Definition at line 39 of file CmsShowSearchFiles.cc.

Referenced by CmsShowSearchFiles::showPrefixes().

◆ s_prefixes

const static char* const s_prefixes[][s_columns]
static
Initial value:
= {{"http://", "Web site known by you", nullptr},
{"file:", "Local file [you must type full path name]", nullptr},
{"dcap://", "dCache [FNAL]", nullptr},
{"rfio://", "Castor [CERN]", nullptr}
}

Definition at line 40 of file CmsShowSearchFiles.cc.

Referenced by CmsShowSearchFiles::showPrefixes().

relmon_authenticated_wget.url
url
Definition: relmon_authenticated_wget.py:22
mps_check.msg
tuple msg
Definition: mps_check.py:285
alignCSCRings.s
s
Definition: alignCSCRings.py:92
visDQMUpload.buf
buf
Definition: visDQMUpload.py:160
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443