23 if (!content.
check(
"main.css")) {
24 if (!options.
check(
"web")) {
25 content.
put(
"main.css",
"\n\
31 font-family: verdana, arial, sans-serif;\n\
36 padding-bottom: 10px;\n\
40 text-decoration: none;\n\
44 text-decoration: none;\n\
48 text-decoration: none;\n\
51 mime.
put(
"main.css",
"text/css");
59 std::string uri = cmd.
check(
"REQUEST_URI",
Value(
"")).toString();
60 if (uri.length()>=4) { uri = uri.substr(4); }
else { uri =
""; }
63 if ((!content.
check(uri))||options.
check(
"no-web-cache")) {
64 if (options.
check(
"web")) {
69 if (ch ==
'.' && !first) {
72 if (ch ==
'/') { first =
true;
continue; }
74 if (ch >=
'a' && ch <=
'z') {
77 if (ch >=
'A' && ch <=
'Z') {
80 if (ch >=
'0' && ch <=
'9') {
83 if (ch ==
'-' || ch ==
'_') {
99 accum += std::string(buf,len);
106 if (uri.find(
".css")!=std::string::npos) {
107 mime.
put(uri,
"text/css");
108 }
else if (uri.find(
".png")!=std::string::npos) {
109 mime.
put(uri,
"image/png");
110 }
else if (uri.find(
".jpg")!=std::string::npos) {
111 mime.
put(uri,
"image/jpeg");
112 }
else if (uri.find(
".js")!=std::string::npos) {
113 mime.
put(uri,
"text/javascript");
115 mime.
put(uri,
"text/html");
120 if (content.
check(uri)) {
123 printf(
" * %s %s %d bytes, %s\n",
A simple collection of objects that can be described and transmitted in a portable way.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
void addString(const char *str)
Places a string in the bottle, at the end of the list.
std::string toString() const override
Gives a human-readable textual representation of the bottle.
A mini-server for performing network communication in the background.
Value & find(const std::string &key) const override
Gets a value corresponding to a given keyword.
void put(const std::string &key, const std::string &value)
Associate the given key with the given string.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
A single value (typically within a Bottle).
virtual std::string asString() const
Get string value.
bool apply(yarp::os::Bottle &cmd, yarp::os::Bottle &reply, yarp::os::Bottle &event, const yarp::os::Contact &remote) override
An interface to the operating system, including Port based communication.