Lines Matching refs:PythonObject
38 template <> Expected<bool> python::As<bool>(Expected<PythonObject> &&obj) {
45 Expected<long long> python::As<long long>(Expected<PythonObject> &&obj) {
53 python::As<unsigned long long>(Expected<PythonObject> &&obj) {
60 Expected<std::string> python::As<std::string>(Expected<PythonObject> &&obj) {
81 void PythonObject::Reset() {
95 Expected<long long> PythonObject::AsLongLong() const {
105 Expected<unsigned long long> PythonObject::AsUnsignedLongLong() const {
116 Expected<unsigned long long> PythonObject::AsModuloUnsignedLongLong() const {
131 // PythonObject
133 void PythonObject::Dump(Stream &strm) const {
153 PyObjectType PythonObject::GetObjectType() const {
182 PythonString PythonObject::Repr() const {
191 PythonString PythonObject::Str() const {
200 PythonObject
201 PythonObject::ResolveNameWithDictionary(llvm::StringRef name,
205 PythonObject result = dict.GetItemForKey(PythonString(piece));
216 PythonObject PythonObject::ResolveName(llvm::StringRef name) const {
236 PythonObject parent = ResolveName(name.substr(0, dot_pos));
238 return PythonObject();
244 bool PythonObject::HasAttribute(llvm::StringRef attr) const {
251 PythonObject PythonObject::GetAttributeValue(llvm::StringRef attr) const {
253 return PythonObject();
257 return PythonObject();
259 return PythonObject(PyRefType::Owned,
263 StructuredData::ObjectSP PythonObject::CreateStructuredObject() const {
294 PythonObject(PyRefType::Borrowed, m_py_obj)));
546 PythonObject PythonList::GetItemAtIndex(uint32_t index) const {
548 return PythonObject(PyRefType::Borrowed, PyList_GetItem(m_py_obj, index));
549 return PythonObject();
552 void PythonList::SetItemAtIndex(uint32_t index, const PythonObject &object) {
561 void PythonList::AppendItem(const PythonObject &object) {
573 PythonObject obj = GetItemAtIndex(i);
590 PythonTuple::PythonTuple(std::initializer_list<PythonObject> objects) {
606 PythonObject object(PyRefType::Borrowed, py_object);
625 PythonObject PythonTuple::GetItemAtIndex(uint32_t index) const {
627 return PythonObject(PyRefType::Borrowed, PyTuple_GetItem(m_py_obj, index));
628 return PythonObject();
631 void PythonTuple::SetItemAtIndex(uint32_t index, const PythonObject &object) {
644 PythonObject obj = GetItemAtIndex(i);
690 PythonObject PythonDictionary::GetItemForKey(const PythonObject &key) const {
694 return PythonObject();
699 Expected<PythonObject>
700 PythonDictionary::GetItem(const PythonObject &key) const {
708 return Retain<PythonObject>(o);
711 Expected<PythonObject> PythonDictionary::GetItem(const Twine &key) const {
719 return Retain<PythonObject>(o);
722 Error PythonDictionary::SetItem(const PythonObject &key,
723 const PythonObject &value) const {
733 const PythonObject &value) const {
742 void PythonDictionary::SetItemForKey(const PythonObject &key,
743 const PythonObject &value) {
755 PythonObject key = keys.GetItemAtIndex(i);
756 PythonObject value = GetItemForKey(key);
779 Expected<PythonObject> PythonModule::Get(const Twine &name) {
788 return Retain<PythonObject>(item);
840 Expected<PythonObject> pyarginfo = get_arg_info(*this);
855 PythonObject PythonCallable::operator()() {
856 return PythonObject(PyRefType::Owned, PyObject_CallObject(m_py_obj, nullptr));
859 PythonObject PythonCallable::
862 return PythonObject(PyRefType::Owned,
866 PythonObject PythonCallable::
867 operator()(std::initializer_list<PythonObject> args) {
869 return PythonObject(PyRefType::Owned,
992 GetOptionsForPyObject(const PythonObject &obj) {
1097 static Expected<PythonBuffer> Create(PythonObject &obj,
1191 auto pybuffer = Take<PythonObject>(pybuffer_p);
1431 Take<PythonObject>(o);
1440 llvm::Expected<PythonObject>
1456 auto code_ref = Take<PythonObject>(code);
1463 return Take<PythonObject>(result);
1466 llvm::Expected<PythonObject>
1476 return Take<PythonObject>(result);