libwolfram20
WAImage.h
Go to the documentation of this file.
1
10#ifndef WAIMAGE_H
11#define WAIMAGE_H
12
13#include <cstring>
14
15#include <rapidxml/rapidxml_utils.hpp>
16
17using namespace rapidxml;
18
24{
25public:
30 WAImage(const WAImage &old) = default;
31 WAImage(xml_node<>* imgNode);
32
33 std::string getSrc();
34 std::string getAlt();
35 std::string getTitle();
36 size_t getWidth();
37 size_t getHeight();
38
39private:
40 // Attributes of 'image' node
41 std::string _src;
42 std::string _alt;
43 std::string _title;
44 size_t _width;
45 size_t _height;
46
47 void parse(xml_node<>* imgNode);
48};
49
50#endif // WAIMAGE_H
size_t getHeight()
Returning a 'height' attribute of image.
Definition: WAImage.cpp:62
void parse(xml_node<> *imgNode)
Parsing a input 'img' xml node.
Definition: WAImage.cpp:72
std::string getSrc()
Returning a 'src' attribute of image.
Definition: WAImage.cpp:26
size_t getWidth()
Returning a 'width' attribute of image.
Definition: WAImage.cpp:53
std::string getAlt()
Returning a 'alt' attribute of image.
Definition: WAImage.cpp:35
std::string getTitle()
Returning a 'title' attribute of image.
Definition: WAImage.cpp:44
WAImage(const WAImage &old)=default
Copy constructor.
Wolfram API image.
Definition: WAImage.h:24
size_t _width
The width of the image in pixels.
Definition: WAImage.h:44
size_t _height
The height of the image in pixels. Scales depending on width setting.
Definition: WAImage.h:45
std::string _src
The exact URL of the image being displayed.
Definition: WAImage.h:41
std::string _title
Descriptive title for internal identification of an image.
Definition: WAImage.h:43
std::string _alt
Alternate text to display in case the image does not render correctly.
Definition: WAImage.h:42