/** void ofConsoleLoggerChannel::log(ofLogLevel level, const string &module, const string &message)
 * api/openFrameworks/utils/ofLog.h:156
 */
static int ofConsoleLoggerChannel_log(lua_State *L) {
  try {
    ofConsoleLoggerChannel *self = *((ofConsoleLoggerChannel **)dub_checksdata(L, 1, "ofConsoleLoggerChannel"));
    int top__ = lua_gettop(L);
    if (top__ >= 5) {
      ofLogLevel logLevel = (ofLogLevel)dub_checkint(L, 2);
      size_t module_sz_;
      const char *module = dub_checklstring(L, 3, &module_sz_);
      const char *format = dub_checkstring(L, 4);
      va_list *args = *((va_list **)dub_checksdata(L, 5, "va"));
      self->log(logLevel, std::string(module, module_sz_), format, *args);
      return 0;
    } else {
      ofLogLevel level = (ofLogLevel)dub_checkint(L, 2);
      size_t module_sz_;
      const char *module = dub_checklstring(L, 3, &module_sz_);
      size_t message_sz_;
      const char *message = dub_checklstring(L, 4, &message_sz_);
      self->log(level, std::string(module, module_sz_), std::string(message, message_sz_));
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "log: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "log: Unknown exception");
  }
  return dub_error(L);
}
示例#2
0
/** bool ofFile::renameTo(string path, bool bRelativeToData=true, bool overwrite=false)
 * api/openFrameworks/utils/ofFileUtils.h:137
 */
static int ofFile_renameTo(lua_State *L) {
  try {
    ofFile *self = *((ofFile **)dub_checksdata(L, 1, "ofFile"));
    int top__ = lua_gettop(L);
    if (top__ >= 4) {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 2, &path_sz_);
      bool bRelativeToData = dub_checkboolean(L, 3);
      bool overwrite = dub_checkboolean(L, 4);
      lua_pushboolean(L, self->renameTo(std::string(path, path_sz_), bRelativeToData, overwrite));
      return 1;
    } else if (top__ >= 3) {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 2, &path_sz_);
      bool bRelativeToData = dub_checkboolean(L, 3);
      lua_pushboolean(L, self->renameTo(std::string(path, path_sz_), bRelativeToData));
      return 1;
    } else {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 2, &path_sz_);
      lua_pushboolean(L, self->renameTo(std::string(path, path_sz_)));
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "renameTo: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "renameTo: Unknown exception");
  }
  return dub_error(L);
}
示例#3
0
/** bool ofFile::open(string path, Mode mode=ReadOnly, bool binary=false)
 * api/openFrameworks/utils/ofFileUtils.h:106
 */
static int ofFile_open(lua_State *L) {
  try {
    ofFile *self = *((ofFile **)dub_checksdata(L, 1, "ofFile"));
    int top__ = lua_gettop(L);
    if (top__ >= 4) {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 2, &path_sz_);
      ofFile::Mode mode = (ofFile::Mode)dub_checkint(L, 3);
      bool binary = dub_checkboolean(L, 4);
      lua_pushboolean(L, self->open(std::string(path, path_sz_), mode, binary));
      return 1;
    } else if (top__ >= 3) {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 2, &path_sz_);
      ofFile::Mode mode = (ofFile::Mode)dub_checkint(L, 3);
      lua_pushboolean(L, self->open(std::string(path, path_sz_), mode));
      return 1;
    } else {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 2, &path_sz_);
      lua_pushboolean(L, self->open(std::string(path, path_sz_)));
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "open: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "open: Unknown exception");
  }
  return dub_error(L);
}
/** ofHttpResponse ofURLFileLoader::saveTo(string url, string path)
 * api/openFrameworks/utils/ofURLFileLoader.h:85
 */
static int ofURLFileLoader_saveTo(lua_State *L) {
  try {
    ofURLFileLoader *self = *((ofURLFileLoader **)dub_checksdata(L, 1, "ofURLFileLoader"));
    size_t url_sz_;
    const char *url = dub_checklstring(L, 2, &url_sz_);
    size_t path_sz_;
    const char *path = dub_checklstring(L, 3, &path_sz_);
    dub_pushudata(L, new ofHttpResponse(self->saveTo(std::string(url, url_sz_), std::string(path, path_sz_))), "ofHttpResponse", true);
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "saveTo: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "saveTo: Unknown exception");
  }
  return dub_error(L);
}
/** int ofURLFileLoader::saveAsync(string url, string path)
 * api/openFrameworks/utils/ofURLFileLoader.h:86
 */
static int ofURLFileLoader_saveAsync(lua_State *L) {
  try {
    ofURLFileLoader *self = *((ofURLFileLoader **)dub_checksdata(L, 1, "ofURLFileLoader"));
    size_t url_sz_;
    const char *url = dub_checklstring(L, 2, &url_sz_);
    size_t path_sz_;
    const char *path = dub_checklstring(L, 3, &path_sz_);
    lua_pushnumber(L, self->saveAsync(std::string(url, url_sz_), std::string(path, path_sz_)));
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "saveAsync: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "saveAsync: Unknown exception");
  }
  return dub_error(L);
}
示例#6
0
/** void ofBuffer::set(const char *_buffer, unsigned int _size)
 * api/openFrameworks/utils/ofFileUtils.h:21
 */
static int ofBuffer_set(lua_State *L) {
  try {
    ofBuffer *self = *((ofBuffer **)dub_checksdata(L, 1, "ofBuffer"));
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      const char *_buffer = dub_checkstring(L, 2);
      unsigned int _size = dub_checkint(L, 3);
      self->set(_buffer, _size);
      return 0;
    } else {
      int type__ = lua_type(L, 2);
      void **ptr2__;
      if ( (ptr2__ = dub_issdata(L, 2, "istream", type__)) ) {
        istream *stream = *((istream **)ptr2__);
        lua_pushboolean(L, self->set(*stream));
        return 1;
      } else {
        size_t text_sz_;
        const char *text = dub_checklstring(L, 2, &text_sz_);
        self->set(std::string(text, text_sz_));
        return 0;
      }
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "set: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "set: Unknown exception");
  }
  return dub_error(L);
}
示例#7
0
/** ofFile::ofFile()
 * api/openFrameworks/utils/ofFileUtils.h:100
 */
static int ofFile_ofFile(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      size_t filePath_sz_;
      const char *filePath = dub_checklstring(L, 1, &filePath_sz_);
      ofFile::Mode mode = (ofFile::Mode)dub_checkint(L, 2);
      bool binary = dub_checkboolean(L, 3);
      ofFile *retval__ = new ofFile(std::string(filePath, filePath_sz_), mode, binary);
      dub_pushudata(L, retval__, "ofFile", true);
      return 1;
    } else if (top__ >= 2) {
      size_t filePath_sz_;
      const char *filePath = dub_checklstring(L, 1, &filePath_sz_);
      ofFile::Mode mode = (ofFile::Mode)dub_checkint(L, 2);
      ofFile *retval__ = new ofFile(std::string(filePath, filePath_sz_), mode);
      dub_pushudata(L, retval__, "ofFile", true);
      return 1;
    } else if (top__ >= 1) {
      int type__ = lua_type(L, 1);
      void **ptr1__;
      if ( (ptr1__ = dub_issdata(L, 1, "ofFile", type__)) ) {
        ofFile *mom = *((ofFile **)ptr1__);
        ofFile *retval__ = new ofFile(*mom);
        dub_pushudata(L, retval__, "ofFile", true);
        return 1;
      } else {
        size_t filePath_sz_;
        const char *filePath = dub_checklstring(L, 1, &filePath_sz_);
        ofFile *retval__ = new ofFile(std::string(filePath, filePath_sz_));
        dub_pushudata(L, retval__, "ofFile", true);
        return 1;
      }
    } else {
      ofFile *retval__ = new ofFile();
      dub_pushudata(L, retval__, "ofFile", true);
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "new: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "new: Unknown exception");
  }
  return dub_error(L);
}
示例#8
0
/** static bool ofFile::moveFromTo(string pathSrc, string pathDst, bool bRelativeToData=true, bool overwrite=false)
 * api/openFrameworks/utils/ofFileUtils.h:184
 */
static int ofFile_moveFromTo(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 4) {
      size_t pathSrc_sz_;
      const char *pathSrc = dub_checklstring(L, 1, &pathSrc_sz_);
      size_t pathDst_sz_;
      const char *pathDst = dub_checklstring(L, 2, &pathDst_sz_);
      bool bRelativeToData = dub_checkboolean(L, 3);
      bool overwrite = dub_checkboolean(L, 4);
      lua_pushboolean(L, ofFile::moveFromTo(std::string(pathSrc, pathSrc_sz_), std::string(pathDst, pathDst_sz_), bRelativeToData, overwrite));
      return 1;
    } else if (top__ >= 3) {
      size_t pathSrc_sz_;
      const char *pathSrc = dub_checklstring(L, 1, &pathSrc_sz_);
      size_t pathDst_sz_;
      const char *pathDst = dub_checklstring(L, 2, &pathDst_sz_);
      bool bRelativeToData = dub_checkboolean(L, 3);
      lua_pushboolean(L, ofFile::moveFromTo(std::string(pathSrc, pathSrc_sz_), std::string(pathDst, pathDst_sz_), bRelativeToData));
      return 1;
    } else {
      size_t pathSrc_sz_;
      const char *pathSrc = dub_checklstring(L, 1, &pathSrc_sz_);
      size_t pathDst_sz_;
      const char *pathDst = dub_checklstring(L, 2, &pathDst_sz_);
      lua_pushboolean(L, ofFile::moveFromTo(std::string(pathSrc, pathSrc_sz_), std::string(pathDst, pathDst_sz_)));
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "moveFromTo: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "moveFromTo: Unknown exception");
  }
  return dub_error(L);
}
示例#9
0
/** static bool ofFile::doesFileExist(string fPath, bool bRelativeToData=true)
 * api/openFrameworks/utils/ofFileUtils.h:185
 */
static int ofFile_doesFileExist(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      size_t fPath_sz_;
      const char *fPath = dub_checklstring(L, 1, &fPath_sz_);
      bool bRelativeToData = dub_checkboolean(L, 2);
      lua_pushboolean(L, ofFile::doesFileExist(std::string(fPath, fPath_sz_), bRelativeToData));
      return 1;
    } else {
      size_t fPath_sz_;
      const char *fPath = dub_checklstring(L, 1, &fPath_sz_);
      lua_pushboolean(L, ofFile::doesFileExist(std::string(fPath, fPath_sz_)));
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "doesFileExist: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "doesFileExist: Unknown exception");
  }
  return dub_error(L);
}
示例#10
0
/** static bool ofFile::removeFile(string path, bool bRelativeToData=true)
 * api/openFrameworks/utils/ofFileUtils.h:186
 */
static int ofFile_removeFile(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 1, &path_sz_);
      bool bRelativeToData = dub_checkboolean(L, 2);
      lua_pushboolean(L, ofFile::removeFile(std::string(path, path_sz_), bRelativeToData));
      return 1;
    } else {
      size_t path_sz_;
      const char *path = dub_checklstring(L, 1, &path_sz_);
      lua_pushboolean(L, ofFile::removeFile(std::string(path, path_sz_)));
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "removeFile: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "removeFile: Unknown exception");
  }
  return dub_error(L);
}
示例#11
0
/** ofBuffer& ofBuffer::operator=(const string &text)
 * api/openFrameworks/utils/ofFileUtils.h:38
 */
static int ofBuffer_operator_sete(lua_State *L) {
  try {
    ofBuffer *self = *((ofBuffer **)dub_checksdata(L, 1, "ofBuffer"));
    size_t text_sz_;
    const char *text = dub_checklstring(L, 2, &text_sz_);
    dub_pushudata(L, &self->operator=(std::string(text, text_sz_)), "ofBuffer", false);
    return 1;
  } catch (std::exception &e) {
    lua_pushfstring(L, "set: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "set: Unknown exception");
  }
  return dub_error(L);
}
示例#12
0
/** int ofURLFileLoader::getAsync(string url, string name="")
 * api/openFrameworks/utils/ofURLFileLoader.h:84
 */
static int ofURLFileLoader_getAsync(lua_State *L) {
  try {
    ofURLFileLoader *self = *((ofURLFileLoader **)dub_checksdata(L, 1, "ofURLFileLoader"));
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      size_t url_sz_;
      const char *url = dub_checklstring(L, 2, &url_sz_);
      size_t name_sz_;
      const char *name = dub_checklstring(L, 3, &name_sz_);
      lua_pushnumber(L, self->getAsync(std::string(url, url_sz_), std::string(name, name_sz_)));
      return 1;
    } else {
      size_t url_sz_;
      const char *url = dub_checklstring(L, 2, &url_sz_);
      lua_pushnumber(L, self->getAsync(std::string(url, url_sz_)));
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "getAsync: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "getAsync: Unknown exception");
  }
  return dub_error(L);
}
示例#13
0
/** void QWidget::setWindowTitle(const QString &text)
 * bind/QWidget.h:38
 */
static int Widget_setWindowTitle(lua_State *L) {
  try {
    Widget *self = *((Widget **)dub_checksdata(L, 1, "mimas.Widget"));
    size_t text_sz_;
    const char *text = dub_checklstring(L, 2, &text_sz_);
    
    self->setWindowTitle(QString::fromUtf8(text, text_sz_));
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setWindowTitle: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setWindowTitle: Unknown exception");
  }
  return dub_error(L);
}
示例#14
0
/** void QWidget::setToolTip(const QString &text)
 * bind/QWidget.h:39
 */
static int TableView_setToolTip(lua_State *L) {
  try {
    TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
    size_t text_sz_;
    const char *text = dub_checklstring(L, 2, &text_sz_);
    
    self->setToolTip(QString::fromUtf8(text, text_sz_));
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setToolTip: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setToolTip: Unknown exception");
  }
  return dub_error(L);
}
示例#15
0
/** void QLineEdit::setText(const QString &str)
 * bind/QLineEdit.h:10
 */
static int LineEdit_setText(lua_State *L) {
  try {
    LineEdit *self = *((LineEdit **)dub_checksdata(L, 1, "mimas.LineEdit"));
    size_t str_sz_;
    const char *str = dub_checklstring(L, 2, &str_sz_);
    
    self->setText(QString::fromUtf8(str, str_sz_));
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setText: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setText: Unknown exception");
  }
  return dub_error(L);
}
示例#16
0
/** void QObject::setObjectName(const QString &name)
 * bind/QObject.h:8
 */
static int TableView_setObjectName(lua_State *L) {
  try {
    TableView *self = *((TableView **)dub_checksdata(L, 1, "mimas.TableView"));
    size_t name_sz_;
    const char *name = dub_checklstring(L, 2, &name_sz_);
    
    self->setObjectName(QString::fromUtf8(name, name_sz_));
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "setObjectName: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "setObjectName: Unknown exception");
  }
  return dub_error(L);
}
示例#17
0
/** ofBuffer::ofBuffer()
 * api/openFrameworks/utils/ofFileUtils.h:13
 */
static int ofBuffer_ofBuffer(lua_State *L) {
  try {
    int top__ = lua_gettop(L);
    if (top__ >= 2) {
      const char *buffer = dub_checkstring(L, 1);
      unsigned int size = dub_checkint(L, 2);
      ofBuffer *retval__ = new ofBuffer(buffer, size);
      dub_pushudata(L, retval__, "ofBuffer", true);
      return 1;
    } else if (top__ >= 1) {
      int type__ = lua_type(L, 1);
      void **ptr1__;
      if ( (ptr1__ = dub_issdata(L, 1, "istream", type__)) ) {
        istream *stream = *((istream **)ptr1__);
        ofBuffer *retval__ = new ofBuffer(*stream);
        dub_pushudata(L, retval__, "ofBuffer", true);
        return 1;
      } else if ( (ptr1__ = dub_issdata(L, 1, "ofBuffer", type__)) ) {
        ofBuffer *buffer_ = *((ofBuffer **)ptr1__);
        ofBuffer *retval__ = new ofBuffer(*buffer_);
        dub_pushudata(L, retval__, "ofBuffer", true);
        return 1;
      } else {
        size_t text_sz_;
        const char *text = dub_checklstring(L, 1, &text_sz_);
        ofBuffer *retval__ = new ofBuffer(std::string(text, text_sz_));
        dub_pushudata(L, retval__, "ofBuffer", true);
        return 1;
      }
    } else {
      ofBuffer *retval__ = new ofBuffer();
      dub_pushudata(L, retval__, "ofBuffer", true);
      return 1;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "new: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "new: Unknown exception");
  }
  return dub_error(L);
}
示例#18
0
/** void ofBuffer::append(const string &_buffer)
 * api/openFrameworks/utils/ofFileUtils.h:24
 */
static int ofBuffer_append(lua_State *L) {
  try {
    ofBuffer *self = *((ofBuffer **)dub_checksdata(L, 1, "ofBuffer"));
    int top__ = lua_gettop(L);
    if (top__ >= 3) {
      const char *_buffer = dub_checkstring(L, 2);
      unsigned int _size = dub_checkint(L, 3);
      self->append(_buffer, _size);
      return 0;
    } else {
      size_t _buffer_sz_;
      const char *_buffer = dub_checklstring(L, 2, &_buffer_sz_);
      self->append(std::string(_buffer, _buffer_sz_));
      return 0;
    }
  } catch (std::exception &e) {
    lua_pushfstring(L, "append: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "append: Unknown exception");
  }
  return dub_error(L);
}