comparison OrthancServer/OrthancRestApi/OrthancRestResources.cpp @ 1303:bba8a47922d1

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 10 Feb 2015 16:47:24 +0100
parents 6e7e5ed91c2d
children 9ec7ac03152d
comparison
equal deleted inserted replaced
1302:5fe254fb1c93 1303:bba8a47922d1
624 // Loop over the instances 624 // Loop over the instances
625 bool isFirst = true; 625 bool isFirst = true;
626 shared = Json::objectValue; 626 shared = Json::objectValue;
627 627
628 for (Instances::const_iterator it = instances.begin(); 628 for (Instances::const_iterator it = instances.begin();
629 it != instances.end(); it++) 629 it != instances.end(); ++it)
630 { 630 {
631 // Get the tags of the current instance, in the simplified format 631 // Get the tags of the current instance, in the simplified format
632 Json::Value tags; 632 Json::Value tags;
633 633
634 try 634 try
753 753
754 context.ReadJson(tags, publicId); 754 context.ReadJson(tags, publicId);
755 755
756 // Filter the tags of the instance according to the module 756 // Filter the tags of the instance according to the module
757 Json::Value result = Json::objectValue; 757 Json::Value result = Json::objectValue;
758 for (ModuleTags::const_iterator tag = moduleTags.begin(); tag != moduleTags.end(); tag++) 758 for (ModuleTags::const_iterator tag = moduleTags.begin(); tag != moduleTags.end(); ++tag)
759 { 759 {
760 std::string s = tag->Format(); 760 std::string s = tag->Format();
761 if (tags.isMember(s)) 761 if (tags.isMember(s))
762 { 762 {
763 result[s] = tags[s]; 763 result[s] = tags[s];
796 OrthancRestApi::GetIndex(call).LookupIdentifier(resources, tag); 796 OrthancRestApi::GetIndex(call).LookupIdentifier(resources, tag);
797 797
798 Json::Value result = Json::arrayValue; 798 Json::Value result = Json::arrayValue;
799 799
800 for (Resources::const_iterator it = resources.begin(); 800 for (Resources::const_iterator it = resources.begin();
801 it != resources.end(); it++) 801 it != resources.end(); ++it)
802 { 802 {
803 ResourceType type = it->first; 803 ResourceType type = it->first;
804 const std::string& id = it->second; 804 const std::string& id = it->second;
805 805
806 Json::Value item = Json::objectValue; 806 Json::Value item = Json::objectValue;
828 while (type != end) 828 while (type != end)
829 { 829 {
830 b.clear(); 830 b.clear();
831 831
832 for (std::list<std::string>::const_iterator 832 for (std::list<std::string>::const_iterator
833 it = a.begin(); it != a.end(); it++) 833 it = a.begin(); it != a.end(); ++it)
834 { 834 {
835 index.GetChildren(c, *it); 835 index.GetChildren(c, *it);
836 b.splice(b.begin(), c); 836 b.splice(b.begin(), c);
837 } 837 }
838 838
859 } 859 }
860 860
861 Json::Value result = Json::arrayValue; 861 Json::Value result = Json::arrayValue;
862 862
863 for (std::list<std::string>::const_iterator 863 for (std::list<std::string>::const_iterator
864 it = a.begin(); it != a.end(); it++) 864 it = a.begin(); it != a.end(); ++it)
865 { 865 {
866 Json::Value item; 866 Json::Value item;
867 867
868 if (OrthancRestApi::GetIndex(call).LookupResource(item, *it, end)) 868 if (OrthancRestApi::GetIndex(call).LookupResource(item, *it, end))
869 { 869 {
888 context.GetIndex().GetChildInstances(instances, publicId); // (*) 888 context.GetIndex().GetChildInstances(instances, publicId); // (*)
889 889
890 Json::Value result = Json::objectValue; 890 Json::Value result = Json::objectValue;
891 891
892 for (Instances::const_iterator it = instances.begin(); 892 for (Instances::const_iterator it = instances.begin();
893 it != instances.end(); it++) 893 it != instances.end(); ++it)
894 { 894 {
895 Json::Value full; 895 Json::Value full;
896 context.ReadJson(full, *it); 896 context.ReadJson(full, *it);
897 897
898 if (simplify) 898 if (simplify)