gphoto2pp
A C++ Wrapper for libgphoto2
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros
gphoto2pp::CameraListWrapper Class Reference

#include <camera_list_wrapper.hpp>

Public Member Functions

 CameraListWrapper ()
 ~CameraListWrapper ()
 CameraListWrapper (CameraListWrapper &&other)
CameraListWrapperoperator= (CameraListWrapper &&other)
 CameraListWrapper (CameraListWrapper const &other)
CameraListWrapperoperator= (CameraListWrapper const &other)
gphoto2::_CameraList * getPtr () const
int count () const
 Gets the number of cameras contained in the list.
std::string getName (int index) const
 Gets the model name of the camera at the index.
std::string getValue (int index) const
 Gets the port of the camera at the index.
void setName (int index, std::string const &name)
 Sets the camera model name at the specified index.
void setValue (int index, std::string const &value)
 Sets the camera port at the specified index.
void append (std::string const &name, std::string const &value)
 Adds a new camera model and port pair.
void reset ()
 Erases all model and port pairs in the current list.
void sort ()
 Sorts the list based on the name (camera model)
int findByName (std::string const &name) const
 Sorts the list based on the name (camera model)
std::pair< std::string,
std::string > 
getPair (int index) const
 Gets the name (model) and value (port) pair.
std::pair< std::string,
std::string > 
getPairByName (std::string const &name) const
 Gets the name (model) and value (port) pair by searching the name.

Constructor & Destructor Documentation

gphoto2pp::CameraListWrapper::CameraListWrapper ( )
gphoto2pp::CameraListWrapper::~CameraListWrapper ( )
gphoto2pp::CameraListWrapper::CameraListWrapper ( CameraListWrapper &&  other)
gphoto2pp::CameraListWrapper::CameraListWrapper ( CameraListWrapper const &  other)

Member Function Documentation

void gphoto2pp::CameraListWrapper::append ( std::string const &  name,
std::string const &  value 
)

Adds a new camera model and port pair.

Parameters
[in]nameof the camera model
[in]valueof the port connected to the camera
Note
Direct wrapper for gp_list_append(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
int gphoto2pp::CameraListWrapper::count ( ) const

Gets the number of cameras contained in the list.

Returns
the number of cameras
Note
Direct wrapper for gp_list_count(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
int gphoto2pp::CameraListWrapper::findByName ( std::string const &  name) const

Sorts the list based on the name (camera model)

Parameters
[in]nameof the model to search for
Note
Direct wrapper for gp_list_sort(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
std::string gphoto2pp::CameraListWrapper::getName ( int  index) const

Gets the model name of the camera at the index.

Parameters
[in]indexof the model name to get
Returns
the camera model name
Note
Direct wrapper for gp_list_get_name(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
std::string gphoto2pp::CameraListWrapper::getPair ( int  index) const

Gets the name (model) and value (port) pair.

Parameters
[in]indexof the model/port pair to get
Returns
the model/port pair
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
std::pair< std::string, std::string > gphoto2pp::CameraListWrapper::getPairByName ( std::string const &  name) const

Gets the name (model) and value (port) pair by searching the name.

Parameters
[in]nameof the model to search for
Returns
the model pair
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
gphoto2::_CameraList* gphoto2pp::CameraListWrapper::getPtr ( ) const
std::string gphoto2pp::CameraListWrapper::getValue ( int  index) const

Gets the port of the camera at the index.

Parameters
[in]indexof the port value to get
Returns
the port which the camera is connected to
Note
Direct wrapper for gp_list_get_value(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
CameraListWrapper& gphoto2pp::CameraListWrapper::operator= ( CameraListWrapper &&  other)
CameraListWrapper& gphoto2pp::CameraListWrapper::operator= ( CameraListWrapper const &  other)
void gphoto2pp::CameraListWrapper::reset ( )

Erases all model and port pairs in the current list.

Note
Direct wrapper for gp_list_reset(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
void gphoto2pp::CameraListWrapper::setName ( int  index,
std::string const &  name 
)

Sets the camera model name at the specified index.

Parameters
[in]indexof the name to set
[in]nameof the model to set
Note
Direct wrapper for gp_list_set_name(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
void gphoto2pp::CameraListWrapper::setValue ( int  index,
std::string const &  value 
)

Sets the camera port at the specified index.

Parameters
[in]indexof the port to set
[in]valueof the port name to set
Note
Direct wrapper for gp_list_set_value(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception
void gphoto2pp::CameraListWrapper::sort ( )

Sorts the list based on the name (camera model)

Note
Direct wrapper for gp_list_sort(...)
Exceptions
GPhoto2pp::exceptions::gphoto2_exception

The documentation for this class was generated from the following files: