comparison OrthancFramework/Sources/Lua/LuaContext.cpp @ 5807:8279eaab0d1d attach-custom-data

merged default -> attach-custom-data
author Alain Mazy <am@orthanc.team>
date Tue, 24 Sep 2024 11:39:52 +0200
parents f7adfb22e20e
children
comparison
equal deleted inserted replaced
5085:79f98ee4f04b 5807:8279eaab0d1d
1 /** 1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store 2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics 3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium 4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium 5 * Copyright (C) 2017-2023 Osimis S.A., Belgium
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium 6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
7 * 8 *
8 * This program is free software: you can redistribute it and/or 9 * This program is free software: you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License 10 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation, either version 3 of 11 * as published by the Free Software Foundation, either version 3 of
11 * the License, or (at your option) any later version. 12 * the License, or (at your option) any later version.
394 if (value.isString()) 395 if (value.isString())
395 { 396 {
396 const std::string s = value.asString(); 397 const std::string s = value.asString();
397 lua_pushlstring(lua_, s.c_str(), s.size()); 398 lua_pushlstring(lua_, s.c_str(), s.size());
398 } 399 }
400 else if (value.isInt())
401 {
402 lua_pushinteger(lua_, value.asInt());
403 }
404 else if (value.isUInt())
405 {
406 lua_pushinteger(lua_, value.asUInt());
407 }
399 else if (value.isDouble()) 408 else if (value.isDouble())
400 { 409 {
401 lua_pushnumber(lua_, value.asDouble()); 410 lua_pushnumber(lua_, value.asDouble());
402 }
403 else if (value.isInt())
404 {
405 lua_pushinteger(lua_, value.asInt());
406 }
407 else if (value.isUInt())
408 {
409 lua_pushinteger(lua_, value.asUInt());
410 } 411 }
411 else if (value.isBool()) 412 else if (value.isBool())
412 { 413 {
413 lua_pushboolean(lua_, value.asBool()); 414 lua_pushboolean(lua_, value.asBool());
414 } 415 }