【问题标题】:Search for a Json String搜索 Json 字符串
【发布时间】:2016-10-11 03:16:30
【问题描述】:

您好,我使用的是 Spirit_Json,但我对 json 的了解并不多,并且想知道如何从该文件中获取字符串/整数。

像 get 函数之类的?

{
     "Rune_fire1": {
     "level": 1,
         "name": "Fire Rune 1",
         "damage": 1,
         "hp": 0,
         "runecost": 0,
         "defense": 0,
         "negate": 0,
         "evasion": 0,
         "healing": 0,


         "description": "The First Shard of the Fire Rune."
     },


     "Rune_fire2": {
     "level": 1,
         "name": "Fire Rune 2",
         "damage": 2,
         "hp": 0,
         "runecost": 0,
         "defense": 0,
         "negate": 0,
         "evasion": 0,
         "healing": 0,
         "description": "The Second Shard of the Fire Rune."
     },


     "Rune_fire3": {
     "level": 1,
         "name": "Fire Rune 3",
         "damage": 3,
         "hp": 0,
         "runecost": 0,
         "defense": 0,
         "negate": 0,
         "evasion": 0,
         "healing": 0,
         "description": "The Third Shard of the Fire Rune."
     },


     "Rune_fire4": {
     "level": 1,
         "name": "Fire Rune 4",
         "damage": 4,
         "hp": 0,
         "runecost": 0,
         "defense": 0,
         "negate": 0,
         "evasion": 0,
         "healing": 0,
         "description": "The Fourth Shard of the Fire Rune."
     },


     "Rune_fire5": {
     "level": 1,
         "name": "Fire Rune 5",
         "damage": 5,
         "hp": 0,
         "runecost": 0,
         "defense": 0,
         "negate": 0,
         "evasion": 0,
         "healing": 0,
         "description": "The Fifth Shard of the Fire Rune."
     },

【问题讨论】:

    标签: c++ json


    【解决方案1】:

    您可以使用 json 库。有一个带有 boost-lib 的: enter link description here

    还有其他类似jsoncpp的。

    【讨论】:

      猜你喜欢
      • 2020-04-12
      • 1970-01-01
      • 2015-12-07
      • 2019-09-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-29
      相关资源
      最近更新 更多