summaryrefslogtreecommitdiff
path: root/src/value.cpp
diff options
context:
space:
mode:
authorEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-05 10:17:26 +0100
committerEmiel Bruijntjes <emiel.bruijntjes@copernica.com>2014-03-05 10:17:26 +0100
commited200cc18fb5fea88b8e9e2ff730af6cf1d50663 (patch)
treeaf2db9588d957d8cbdcb50cd7ce2d448eb4ef3a9 /src/value.cpp
parent29ea3a29642f5cec612f102683e6d43aba226148 (diff)
fixed some compiler warnings in value.cpp, added documentation on how to install PHP-CPP, removed the Makefile from the src directory and moved everything into the single Makefile in the library root directory, also updated the main (and now only) Makefile with instructions so that it is easier for others to understand
Diffstat (limited to 'src/value.cpp')
-rw-r--r--src/value.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/value.cpp b/src/value.cpp
index b43d72f..1bec146 100644
--- a/src/value.cpp
+++ b/src/value.cpp
@@ -329,6 +329,9 @@ Value &Value::operator=(Value &&value)
// the other object is no longer valid
value._val = nullptr;
}
+
+ // done
+ return *this;
}
/**
@@ -1201,13 +1204,17 @@ Value &Value::setType(Type type)
// run the conversion
switch (type) {
- case Type::Null: convert_to_null(_val); break;
- case Type::Numeric: convert_to_long(_val); break;
- case Type::Float: convert_to_double(_val); break;
- case Type::Bool: convert_to_boolean(_val); break;
- case Type::Array: convert_to_array(_val); break;
- case Type::Object: convert_to_object(_val); break;
- case Type::String: convert_to_string(_val); break;
+ case Type::Null: convert_to_null(_val); break;
+ case Type::Numeric: convert_to_long(_val); break;
+ case Type::Float: convert_to_double(_val); break;
+ case Type::Bool: convert_to_boolean(_val); break;
+ case Type::Array: convert_to_array(_val); break;
+ case Type::Object: convert_to_object(_val); break;
+ case Type::String: convert_to_string(_val); break;
+ case Type::Resource: throw Php::Exception("Resource types can not be handled by the PHP-CPP library"); break;
+ case Type::Constant: throw Php::Exception("Constant types can not be assigned to a PHP-CPP library variable"); break;
+ case Type::ConstantArray: throw Php::Exception("Constant types can not be assigned to a PHP-CPP library variable"); break;
+ case Type::Callable: throw Php::Exception("Callable types can not be assigned to a PHP-CPP library variable"); break;
}
// done