apt  2.2.4
About: Apt (Advanced Package Tool) is a management system for software packages (Debian/Ubuntu). Release series 2.2.
  Fossies Dox: apt-2.2.4.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

private-json-hooks.cc File Reference
#include <apt-pkg/debsystem.h>
#include <apt-pkg/fileutl.h>
#include <apt-pkg/macros.h>
#include <apt-pkg/strutl.h>
#include <apt-private/private-json-hooks.h>
#include <apt-private/private-output.h>
#include <iomanip>
#include <ostream>
#include <sstream>
#include <stack>
#include <signal.h>
#include <sys/socket.h>
#include <sys/types.h>
Include dependency graph for private-json-hooks.cc:

Go to the source code of this file.

Classes

class  JsonWriter
 Simple JSON writer. More...
 

Functions

static void verIterToJson (JsonWriter &writer, CacheFile &Cache, pkgCache::VerIterator const &Ver)
 Write a VerIterator to a JsonWriter. More...
 
static void DpkgChrootDirectory ()
 Copy of debSystem::DpkgChrootDirectory() More...
 
static void NotifyHook (std::ostream &os, std::string const &method, const char **FileList, CacheFile &Cache, std::set< std::string > const &UnknownPackages)
 Send a notification to the hook's stream. More...
 
static std::string BuildHelloMessage ()
 Build the hello handshake message for 0.1 protocol. More...
 
static std::string BuildByeMessage ()
 Build the bye notification for 0.1 protocol. More...
 
bool RunJsonHook (std::string const &option, std::string const &method, const char **FileList, CacheFile &Cache, std::set< std::string > const &UnknownPackages)
 Run the Json hook processes in the given option. More...
 

Function Documentation

◆ BuildByeMessage()

static std::string BuildByeMessage ( )
static

Build the bye notification for 0.1 protocol.

Definition at line 315 of file private-json-hooks.cc.

References JsonWriter::beginObject(), JsonWriter::endObject(), JsonWriter::name(), and JsonWriter::value().

Referenced by RunJsonHook().

◆ BuildHelloMessage()

static std::string BuildHelloMessage ( )
static

Build the hello handshake message for 0.1 protocol.

Definition at line 306 of file private-json-hooks.cc.

References JsonWriter::beginArray(), JsonWriter::beginObject(), JsonWriter::endArray(), JsonWriter::endObject(), JsonWriter::name(), and JsonWriter::value().

Referenced by RunJsonHook().

◆ DpkgChrootDirectory()

static void DpkgChrootDirectory ( )
static

Copy of debSystem::DpkgChrootDirectory()

Todo:
Remove

Definition at line 218 of file private-json-hooks.cc.

References _config, and Configuration::FindDir().

Referenced by RunJsonHook().

◆ NotifyHook()

static void NotifyHook ( std::ostream &  os,
std::string const &  method,
const char **  FileList,
CacheFile Cache,
std::set< std::string > const &  UnknownPackages 
)
static

◆ RunJsonHook()

bool RunJsonHook ( std::string const &  option,
std::string const &  method,
const char **  FileList,
CacheFile Cache,
std::set< std::string > const &  UnknownPackages 
)

◆ verIterToJson()

static void verIterToJson ( JsonWriter writer,
CacheFile Cache,
pkgCache::VerIterator const &  Ver 
)
static