<commit_before>/* bzflag
* Copyright (c) 1993 - 2005 <NAME>
*
* This package is free software;  you can redistribute it and/or
* modify it under the terms of the license found in the file
* named LICENSE that should have accompanied this file.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/

/*
 * abstracted URL class
 */

#ifndef URL_MANAGER_H
#define URL_MANAGER_H

// system headers
#include <string>
#include <map>
#include <vector>

// local implementation headers
#include "Singleton.h"

class URLManager : public Singleton<URLManager> {
public:
  bool getURL(const std::string URL, std::string &data);
  bool getURL(const std::string URL, void **data, unsigned int& size);

  void freeURLData(void *data);

  void collectData(char* ptr, int len);

protected:
  friend class Singleton<URLManager>;
  URLManager();
  ~URLManager();

private:
  void clearInternal();
  bool beginGet(const std::string URL);

  // this is CURL specific
  void *easyHandle;

  void *theData;
  unsigned int theLen;
};


#endif // URL_MANAGER_H

// Local Variables: ***
// mode:C++ ***
// tab-width: 8 ***
// c-basic-offset: 2 ***
// indent-tabs-mode: t ***
// End: ***
// ex: shiftwidth=2 tabstop=8

<commit_msg>common.h first.  As Tupone says, a rule is a rule.<commit_after>/* bzflag
* Copyright (c) 1993 - 2005 <NAME>
*
* This package is free software;  you can redistribute it and/or
* modify it under the terms of the license found in the file
* named LICENSE that should have accompanied this file.
*
* THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
*/

/*
 * abstracted URL class
 */

#ifndef URL_MANAGER_H
#define URL_MANAGER_H

// bzflag common header
#include "common.h"

// system headers
#include <string>
#include <map>
#include <vector>

// local implementation headers
#include "Singleton.h"

class URLManager : public Singleton<URLManager> {
public:
  bool getURL(const std::string URL, std::string &data);
  bool getURL(const std::string URL, void **data, unsigned int& size);

  void freeURLData(void *data);

  void collectData(char* ptr, int len);

protected:
  friend class Singleton<URLManager>;
  URLManager();
  ~URLManager();

private:
  void clearInternal();
  bool beginGet(const std::string URL);

  // this is CURL specific
  void *easyHandle;

  void *theData;
  unsigned int theLen;
};


#endif // URL_MANAGER_H

// Local Variables: ***
// mode:C++ ***
// tab-width: 8 ***
// c-basic-offset: 2 ***
// indent-tabs-mode: t ***
// End: ***
// ex: shiftwidth=2 tabstop=8


{'fraction_non_alphanumeric': 0.12464183381088825, 'fraction_numerical': 0.008595988538681949, 'mean_word_length': 4.041516245487364, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5859887', 'n_tokens_mistral': 905, 'n_tokens_neox': 863, 'n_words': 316}