CodeSonar C++ API
[For improved navigation, enable JavaScript.]
csonar_warningclass.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023, an unpublished work by CodeSecure, Inc.
3  * ALL RIGHTS RESERVED
4  *
5  * Copyright (c) 2013-2023, an unpublished work by GrammaTech, Inc.
6  * ALL RIGHTS RESERVED
7  *
8  * This software is furnished under a license and may be used and
9  * copied only in accordance with the terms of such license and the
10  * inclusion of the above copyright notice. This software or any
11  * other copies thereof may not be provided or otherwise made
12  * available to any other person. Title to and ownership of the
13  * software is retained by CodeSecure, Inc.
14  */
15 
16 #ifndef CSONAR_WARNINGCLASS_H
17 #define CSONAR_WARNINGCLASS_H
18 
19 #include "csurf/src/api/cpp/cs_api.hpp"
20 #include "codesonar/src/progtrav/csonar_plugin.h"
21 
26 namespace cs{
27 
31  class report_flags{
32  CS_FLAGS_BOILERPLATE(report_flags, cs_report_flags,
33  csrf_all,
34  "already_xml_encoded",
35  "dont_mark_contributing");
37  static const report_flags NONE;
38 
41 
49  };
50  CS_FLAGS_BOILERPLATE_FRIENDS(report_flags,
51  friend class warningclass;,
52  cs
53  );
54 #ifdef CS_CPP_IMPL
55  const report_flags report_flags::NONE = report_flags(csrf_none);
56  const report_flags report_flags::ALREADY_XML_ENCODED = report_flags(csrf_already_xml_encoded);
57  const report_flags report_flags::DONT_MARK_CONTRIBUTING = report_flags(csrf_dont_mark_contributing);
58 #endif
59 
61  class cfg_path_node_flags{
62  CS_FLAGS_BOILERPLATE(
63  cfg_path_node_flags, cs_cfg_path_node_flags,
64  cscpnf_all,
65  "already_xml_encoded",
66  "dont_mark_contributing",
67  "endbox",
68  "primary",
69  "contributes",
70  "new_path"
71  );
73  static const cfg_path_node_flags NONE;
74 
75 
79 
84  static const cfg_path_node_flags ENDBOX;
85 
91 
97  static const cfg_path_node_flags PRIMARY;
98 
103  static const cfg_path_node_flags CONTRIBUTES;
104 
118  static const cfg_path_node_flags NEW_PATH;
119  };
120  CS_FLAGS_BOILERPLATE_FRIENDS(cfg_path_node_flags,
121  friend class cglue<cfg_path_node>;,
122  cs
123  );
124 #ifdef CS_CPP_IMPL
132 #endif
136  class locations_node_flags{
137  CS_FLAGS_BOILERPLATE(
138  locations_node_flags, cs_locations_node_flags,
139  cslnf_all,
140  "already_xml_encoded",
141  "dont_mark_contributing",
142  "endbox",
143  "primary",
144  "style0",
145  "style1",
146  "style2",
147  "style3",
148  "alternate_interesting",
149  "interpolate_style",
150  "apply_style_to_line"
151  );
153  static const locations_node_flags NONE;
154 
159 
167  static const locations_node_flags ENDBOX;
168 
176  static const locations_node_flags PRIMARY;
177 
184 
188  static const locations_node_flags STYLE0;
189 
193  static const locations_node_flags STYLE1;
194 
199 
204 
212 
217 
222  };
223  CS_FLAGS_BOILERPLATE_FRIENDS(locations_node_flags,
224  friend class cglue<locations_node>;,
225  cs
226  );
227 #ifdef CS_CPP_IMPL
240 #endif
244  class warningclass_flags{
245  /* don't provide "padding" here, since it is a composite */
246  CS_FLAGS_BOILERPLATE(
247  warningclass_flags, csonar_warningclass_flags,
248  csonar_bcf_all,
249  "warning_point_is_start_point",
250  "show_entire_procedure",
251  "pad_above",
252  "pad_below",
253  "force_path"
254  );
256  static const warningclass_flags NONE;
257 
261 
267 
272 
276  static const warningclass_flags PAD_BELOW;
277 
281  static const warningclass_flags PADDING;
282 
297  };
298  CS_FLAGS_BOILERPLATE_FRIENDS(warningclass_flags,
299  friend class warningclass;
300  friend class analysis;,
302  );
303 #ifdef CS_CPP_IMPL
305  const warningclass_flags warningclass_flags::WARNING_POINT_IS_START_POINT = warningclass_flags(csonar_bcf_warning_point_is_start_point);
306  const warningclass_flags warningclass_flags::SHOW_ENTIRE_PROCEDURE = warningclass_flags(csonar_bcf_show_entire_procedure);
311 #endif
312 
318  class analysis_mode{
319  CS_ENUM_BOILERPLATE_UB(analysis_mode, csonar_analysis_mode,
320  rv = csonar_analysis_mode_name(inner),
321  csam_count);
323  };
324  CS_ENUM_BOILERPLATE_FRIENDS(analysis_mode,
325  friend class analysis;,
326  cs
327  );
329 
330 
341  CS_ENUM_BOILERPLATE_UB(multiprocess_mode, csonar_multiprocess_mode,
342  rv = csonar_multiprocess_mode_name(inner),
343  csam_count);
345  };
346  CS_ENUM_BOILERPLATE_FRIENDS(multiprocess_mode,
347  friend class analysis;,
349  );
351 
357  CS_ENUM_BOILERPLATE_UB(warning_significance, csonar_warning_significance,
358  rv = csonar_warning_significance_name(inner),
359  csws_count);
361  };
362  CS_ENUM_BOILERPLATE_FRIENDS(warning_significance,
363  friend class warningclass;
364  friend class analysis;,
365  cs
366  );
368 
369  CS_NODEFCTOR_TYPE(warningclass)
370 
371 
372 
388  class warning{
390  friend class cglue<warning>;
392  cs_warning_id inner;
393  warning(const cs_warning_id &wid)
394  : inner(wid){}
395  warning();
396  public:
404  warning(const std::string &serialized)
405  {
406  std::stringstream in(serialized);
407  in.clear();
408  inner.wid = 0;
409  inner.pid = 0;
410  inner.uid = 0;
411  in >> inner.wid;
412  in >> inner.pid;
413  in >> inner.uid;
414  if( in.fail() )
415  check(CS_ERROR_INVALID_ARGUMENT);
416  }
417 
422  std::string serialize(void) const
423  {
424  std::stringstream out;
425  out << inner.wid << " ";
426  out << inner.pid << " ";
427  out << inner.uid;
428  return out.str();
429  }
430 
431 
447  void retract()
448  { check(csonar_retract_warning(&inner)); }
449 
451  std::string as_repr() const
452  { return CS_AS_REPR(warning, std::string("...")); }
453 
454 
456  std::string as_string() const
457  { return as_repr(); }
458 
460  CS_BOILERPLATE_HASH_TYPE hash() const
461  {
462  return static_cast<CS_BOILERPLATE_HASH_TYPE>(
463  inner.wid + inner.pid + inner.uid);
464  }
465  };
466  CS_IR_BOILERPLATE_NONMEMBERS(warning, cs);
467 
468  template<>
469  class cglue<warning>
470  {
471  friend class warningclass;
472  friend struct FatTypeTraits<warning>;
473  cglue();
474  public:
475  typedef cs_warning_id ctype;
476  typedef warning type;
477  CS_CXX_API_CGLUE_ACCESS_MODIFIER:
478 
479  static type wrap(const ctype &c)
480  {
481  return warning(c);
482  }
483  static ctype unwrap(const type &c)
484  { return c.inner; }
485  };
486 
506  class warning_retraction_info{
507  typedef cs_warning_retraction_info_t ctype;
508 
510  friend class cglue<warning_retraction_info>;
512  std::vector<procedure> bottom_up_procedures;
513  std::vector<procedure> procedures;
514  std::vector<compunit> compunits;
515 
516  cs_warning_retraction_info_t *unwrap(
517  cs_warning_retraction_info_t *c) const
518  {
519  c->num_bu_pdgs = bottom_up_procedures.size();
520  if( c->num_bu_pdgs )
521  {
522  c->bu_pdgs = new cs_pdg[c->num_bu_pdgs];
523  for( size_t i = 0; i < c->num_bu_pdgs; i++ )
524  c->bu_pdgs[i] = cglue<procedure>::unwrap(
525  bottom_up_procedures[i]);
526  }
527  else
528  {
529  c->bu_pdgs = NULL;
530  }
531  c->num_pdgs = procedures.size();
532  if( c->num_pdgs )
533  {
534  c->pdgs = new cs_pdg[c->num_pdgs];
535  for( size_t i = 0; i < c->num_pdgs; i++ )
536  c->pdgs[i] = cglue<procedure>::unwrap(
537  procedures[i]);
538  }
539  else
540  {
541  c->pdgs = NULL;
542  }
543  c->num_uids = compunits.size();
544  if( c->num_uids )
545  {
546  c->uids = new cs_uid[c->num_uids];
547  for( size_t i = 0; i < c->num_uids; i++ )
548  c->uids[i] = cglue<compunit>::unwrap(
549  compunits[i]);
550  }
551  else
552  {
553  c->uids = NULL;
554  }
555  return c;
556  }
557 
558  static void clean_unwrapped(
559  cs_warning_retraction_info_t *c)
560  {
561  if( !c )
562  return;
563  if( c->pdgs )
564  delete[] c->pdgs;
565  if( c->bu_pdgs )
566  delete[] c->bu_pdgs;
567  if( c->uids )
568  delete[] c->uids;
569  }
570 
571  warning_retraction_info();
572 
573  template <typename T>
574  static void print_set(std::ostream &out, const std::vector<T> &s)
575  {
576  size_t i;
577  out << "{";
578  for( i = 0; i < s.size(); i++ )
579  {
580  if( i )
581  out << ", ";
582  out << s[i];
583  }
584  out << "}";
585  }
586 
587  void print(std::ostream &out) const
588  {
589  out << CS_AS_REPR_PREFIX << "warning_retraction_info ";
590  print_set(out, bottom_up_procedures);
591  out << " ";
592  print_set(out, procedures);
593  out << " ";
594  print_set(out, compunits);
595  out << CS_AS_REPR_SUFFIX;
596  }
597 
599  NOTSWIG(friend std::ostream &operator<<(
600  std::ostream &out,
601  const warning_retraction_info &a ));
604  public:
623  warning_retraction_info(
624  const std::vector<procedure> &_bottom_up_procedures,
625  const std::vector<procedure> &_procedures,
626  const std::vector<compunit> &_compunits)
627  : bottom_up_procedures(_bottom_up_procedures)
628  , procedures(_procedures)
629  , compunits(_compunits){}
630 
631 
633  std::string as_repr() const
634  {
635  std::stringstream buf;
636  print(buf);
637  return buf.str();
638  }
639 
640 
642  std::string as_string() const
643  { return as_repr(); }
644  };
645 
654  inline std::ostream &operator<<(
655  std::ostream &out,
656  const warning_retraction_info &a )
657  {
658  a.print(out);
659  return out;
660  }
661 
662  template<>
663  class cglue<warning_retraction_info>
664  {
665  friend class warningclass;
666 
667  cglue();
668  CS_CXX_API_CGLUE_ACCESS_MODIFIER:
669  typedef cs_warning_retraction_info_t ctype;
670  typedef warning_retraction_info type;
671 
672  static ctype *unwrap(const type &c, ctype *storage)
673  { return c.unwrap(storage); }
674  static void clean_unwrapped(ctype *cri)
675  { warning_retraction_info::clean_unwrapped(cri); }
676  };
677 
678 
685  class cfg_path_node{
687  friend class cglue<cfg_path_node>;
689  point pnt;
690  cs_edge_label edge;
691  std::string event;
692  cfg_path_node_flags flags;
693  cfg_path_node();
694 
695  void print(std::ostream &out) const
696  {
697  out << CS_AS_REPR_PREFIX << "cfg_path_node "
698  << pnt << ", ";
699  if( cs_edge_label_is_null( edge ) )
700  out << "CS_EDGE_LABEL_NULL";
701  else
702  out << edge_label::;
703  out << ", "
704  << event << ", "
705  << flags << CS_AS_REPR_SUFFIX;
706  }
707 
709  NOTSWIG(friend std::ostream &operator<<(
710  std::ostream &out,
711  const cfg_path_node &a ));
714  public:
731  point _pnt,
732  edge_label _edge,
733  const std::string &_event,
734  cfg_path_node_flags _flags)
735  : pnt(_pnt)
736  , edge(cglue<edge_label>::unwrap(_edge))
737  , event(_event)
738  , flags(_flags){}
739 
752  point _pnt,
753  const std::string &_event,
754  cfg_path_node_flags _flags)
755  : pnt(_pnt)
756  , edge(CS_EDGE_LABEL_NULL)
757  , event(_event)
758  , flags(_flags){}
759 
760 
764  point get_source_point() const
765  { return pnt; }
766 
767 
771  edge_label get_edge_label() const
772  {
773  if( cs_edge_label_is_null( edge ) )
774  check(CS_ELEMENT_NOT_PRESENT);
775  return edge_label::;
776  }
777 
778 
782  std::string get_event() const
783  { return event; }
784 
785 
789  cfg_path_node_flags get_flags() const
790  { return flags; }
791 
794  std::string as_repr() const
795  {
796  std::stringstream buf;
797  print(buf);
798  return buf.str();
799  }
800 
802  std::string as_string() const
803  { return as_repr(); }
804  };
806  typedef std::vector<cs::cfg_path_node> cfg_path_node_vector;
807 #ifdef SWIG
808 }
809 %template(cfg_path_node_vector) std::vector<cs::cfg_path_node>;
810 namespace cs{
811 #endif
812 
822  inline std::ostream &operator<<(
823  std::ostream &out,
824  const cfg_path_node &a )
825  {
826  a.print(out);
827  return out;
828  }
829 
830  template<>
831  class cglue<cfg_path_node>{
832  friend class scratchpad<cfg_path_node>;
833  friend class warningclass;
834  cglue();
835  public:
836  typedef cs_cfg_path_node_t ctype;
837  typedef cfg_path_node type;
838  CS_CXX_API_CGLUE_ACCESS_MODIFIER:
839 
840  static type wrap(const ctype &c)
841  {
842  if( cs_edge_label_is_null( c.edge_label ) )
843  {
844  return cfg_path_node(
845  cglue<point>::wrap(c.source_vertex),
846  c.problem ? c.problem : "",
847  cglue<cfg_path_node_flags>::wrap(c.flags));
848  }
849  else
850  {
851  return cfg_path_node(
852  cglue<point>::wrap(c.source_vertex),
853  cglue<edge_label>::wrap(c.edge_label),
854  c.problem ? c.problem : "",
855  cglue<cfg_path_node_flags>::wrap(c.flags));
856  }
857  }
858  static ctype unwrap(const type &c)
859  {
860  ctype rv;
861  rv.source_vertex = cglue<point>::unwrap(c.get_source_point());
862  rv.edge_label = c.edge;
863  rv.problem = c.event.c_str(); /* be very careful with this */
864  rv.flags = cglue<cfg_path_node_flags>::unwrap(c.flags);
865  return rv;
866  }
867  };
868 
869 
875  class locations_node{
877  friend class cglue<locations_node>;
879  sfileinst sfi;
880  line_number start_line;
881  line_number end_line;
882  column_number start_col;
883  column_number end_col;
884  std::string event;
885  locations_node_flags flags;
886  locations_node();
887 
888  void print(std::ostream &out) const
889  {
890  out << CS_AS_REPR_PREFIX << "locations_node "
891  << sfi << ": "
892  << start_line << ':' << start_col << ".."
893  << end_line << ':' << end_col << ", "
894  << event << ", "
895  << flags << CS_AS_REPR_SUFFIX;
896  }
897 
899  NOTSWIG(friend std::ostream &operator<<(
900  std::ostream &out,
901  const locations_node &a ));
904  public:
919  sfileinst _sfi,
920  line_number _line,
921  const std::string &_event,
922  locations_node_flags _flags)
923  : sfi(_sfi)
924  , start_line(_line)
925  , end_line(_line)
926  , start_col( 0 )
927  , end_col( 0 )
928  , event(_event)
929  , flags(_flags){}
930 
959  locations_node(
960  sfileinst _sfi,
961  line_number _start_line,
962  line_number _end_line,
963  column_number _start_col,
964  column_number _end_col,
965  const std::string &_event,
966  locations_node_flags _flags)
967  : sfi(_sfi)
968  , start_line(_start_line)
969  , end_line(_end_line)
970  , start_col(_start_col)
971  , end_col(_end_col)
972  , event(_event)
973  , flags(_flags)
974  {
975  if( _end_line != 0 && _start_line > _end_line )
976  {
977  check( CS_ERROR_INVALID_ARGUMENT );
978  }
979  if( (_end_line == 0 || _end_line == _start_line)
980  && _end_col <= _start_col
981  && _end_col != 0 )
982  {
983  check( CS_ERROR_INVALID_ARGUMENT );
984  }
985  if( _start_col >= CS_MAX_COLUMN )
986  {
987  check( CS_ERROR_INVALID_ARGUMENT );
988  }
989  if( _end_col >= CS_MAX_COLUMN )
990  {
991  check( CS_ERROR_INVALID_ARGUMENT );
992  }
993  if( (_flags & (locations_node_flags::APPLY_STYLE_TO_LINE
994  | locations_node_flags::STYLE0
995  | locations_node_flags::STYLE1
996  | locations_node_flags::STYLE2
997  | locations_node_flags::STYLE3))
998  == locations_node_flags::APPLY_STYLE_TO_LINE )
999  {
1000  check( CS_ERROR_INVALID_ARGUMENT );
1001  }
1002  }
1003 
1004 
1008  sfileinst get_file() const
1009  { return sfi; }
1010 
1011 
1015  line_number get_start_line() const
1016  { return start_line; }
1017 
1021  line_number get_end_line() const
1022  { return end_line; }
1027  column_number get_start_col() const
1028  { return start_col; }
1029 
1033  column_number get_end_col() const
1034  { return end_col; }
1035 
1040  std::string get_event() const
1041  { return event; }
1043 
1047  locations_node_flags get_flags() const
1048  { return flags; }
1049 
1050 
1052  std::string as_repr() const
1053  {
1054  std::stringstream buf;
1055  print(buf);
1056  return buf.str();
1057  }
1058 
1060  std::string as_string() const
1061  { return as_repr(); }
1063  };
1065  typedef std::vector<cs::locations_node> locations_node_vector;
1066 #ifdef SWIG
1067 }
1068 %template(locations_node_vector) std::vector<cs::locations_node>;
1069 namespace cs{
1070 #endif
1071 
1081  inline std::ostream &operator<<(
1082  std::ostream &out,
1083  const locations_node &a )
1084  {
1085  a.print(out);
1086  return out;
1087  }
1088 
1089  template<>
1090  class cglue<locations_node>{
1091  friend class warningclass;
1092  cglue();
1093  public:
1094  typedef cs_locations_node_t ctype;
1095  typedef locations_node type;
1096  CS_CXX_API_CGLUE_ACCESS_MODIFIER:
1097 
1098  static type wrap(const ctype &c)
1099  {
1100  return locations_node(
1101  cglue<sfileinst>::wrap(c.file),
1102  c.start_line,
1103  c.end_line,
1104  c.start_col,
1105  c.end_col,
1106  c.problem ? c.problem : "",
1107  cglue<locations_node_flags>::wrap(c.flags));
1108  }
1109  static ctype unwrap(const type &c)
1110  {
1111  ctype rv;
1112  rv.file = cglue<sfileinst>::unwrap(c.get_file());
1113  rv.start_line = c.start_line;
1114  rv.end_line = c.end_line;
1115  rv.start_col = c.start_col;
1116  rv.end_col = c.end_col;
1117  rv.problem = c.event.c_str(); /* be very careful with this */
1118  rv.flags = cglue<locations_node_flags>::unwrap(c.flags);
1119  return rv;
1120  }
1121  };
1122 
1143  class step_path{
1144  friend class scratchpad<cfg_path_node>;
1145  friend class basic_string_scratchpad<char>;
1146  public:
1147  typedef cs_step_path_t ctype;
1148 
1150  friend class cglue<step_path>;
1152  private:
1153 
1154  cs_step_path_t inner;
1155  step_path(cs_step_path_t _inner): inner(csonar_step_path_copy(_inner)){}
1156  step_path();
1157  cs_step_path_t unwrap() const
1158  { return inner; }
1159  public:
1160 
1162  step_path( const step_path &other )
1163  : inner(csonar_step_path_copy(other.inner))
1164  {}
1165 
1167  ~step_path(){ csonar_step_path_destroy(inner); }
1168 
1175  std::vector<cs::cfg_path_node> to_cfg_node_vector() const
1176  {
1177  typedef scratchpad<cfg_path_node> sp;
1178  sp::to_vector_functor1
1179  <step_path, csonar_step_path_to_list>
1180  functor(inner);
1181  return sp::to_vector(functor);
1182  }
1183 
1185  std::string as_string() const
1186  {
1187  string_scratchpad::
1188  to_string_functor1_limit<step_path, csonar_step_path_to_string>
1189  functor(inner, -1);
1190  return string_scratchpad::to_string(functor);
1191  }
1192 
1194  std::string as_repr() const
1195  { return CS_AS_REPR_FROM_STRING(step_path); }
1196 
1198  CS_BOILERPLATE_HASH_TYPE hash() const
1199  { return static_cast<CS_BOILERPLATE_HASH_TYPE>(reinterpret_cast<uintptr_t>(inner)); }
1200  };
1201  CS_IR_BOILERPLATE_NONMEMBERS(step_path, cs);
1202 
1203  template<>
1204  class cglue<step_path>{
1205  friend class step_state;
1206  friend class warningclass;
1207  friend class scratchpad<cfg_path_node>;
1208  cglue();
1209  public:
1210  typedef cs_step_path_t ctype;
1211  typedef step_path type;
1212  CS_CXX_API_CGLUE_ACCESS_MODIFIER:
1213 
1214  static type wrap(const ctype &c)
1215  { return step_path(c); }
1216  static ctype unwrap(const type &c)
1217  { return c.unwrap(); }
1218  };
1328  class warningclass{
1329  friend class analysis;
1330  typedef cs_warningclass_t ctype;
1331  cs_warningclass_t inner;
1333  friend class cglue<warningclass>;
1335  class delay_factory{
1336  std::string name;
1337  std::string categories;
1338  double rank;
1339  warning_significance significance;
1340  warningclass_flags flags;
1341  warningclass *target;
1342  static void create_wc(void *_ctx)
1343  {
1344  delay_factory *ctx = static_cast<delay_factory*>(_ctx);
1345  if( ctx->target == NULL )
1346  return;
1347  assert( ctx->target->factory == ctx );
1348  if( ctx->target->inner )
1349  check(CS_ERROR_IMMUTABLE_DATA_STRUCTURE);
1350  ctx->target->inner = csonar_create_warningclass(
1351  ctx->name.c_str(),
1352  ctx->categories.c_str(),
1353  ctx->rank,
1354  cglue<warningclass_flags>::unwrap(ctx->flags),
1355  cglue<warning_significance>::unwrap(ctx->significance));
1356  if( !ctx->target->inner )
1357  {
1358  /* This will end badly... Is it actually
1359  * possible?
1360  */
1361  check(CS_ERROR_IMMUTABLE_DATA_STRUCTURE);
1362  }
1363  ctx->target->factory = NULL;
1364  delete ctx;
1365  }
1366 
1367  delay_factory(const delay_factory &other);
1368 
1369  public:
1370  delay_factory(const std::string &_name,
1371  const std::string &_categories,
1372  double _rank,
1373  warningclass_flags _flags,
1374  warning_significance _significance,
1375  warningclass *_target)
1376  : name(_name)
1377  , categories(_categories)
1378  , rank(_rank)
1379  , significance(_significance)
1380  , flags(_flags)
1381  , target(_target)
1382  {
1383  static const cs_language any_lang[] = {
1384  csl_wildcard,
1385  csl_null,
1386  };
1387  csonar_add_setup_visitor(
1388  any_lang,
1389  create_wc,
1390  static_cast<void*>(this) );
1391  }
1392 
1393  delay_factory(const delay_factory &other,
1394  warningclass *_target)
1395  : name(other.name)
1396  , categories(other.categories)
1397  , rank(other.rank)
1398  , significance(other.significance)
1399  , flags(other.flags)
1400  , target(_target)
1401  {
1402  static const cs_language any_lang[] = {
1403  csl_wildcard,
1404  csl_null,
1405  };
1406  csonar_add_setup_visitor(
1407  any_lang,
1408  create_wc,
1409  static_cast<void*>(this) );
1410  }
1411 
1412  void abandon()
1413  { target = NULL; }
1414 
1415  const std::string &get_name() const
1416  { return name; }
1417  };
1418  delay_factory *factory;
1419  warningclass();
1420 
1421  cs_warningclass_t unwrap() const
1422  {
1423  if( !inner )
1424  check(CS_ERROR_INVALID_ARGUMENT);
1425  return inner;
1426  }
1427 
1428  /* Sorry, not implemented (don't use swap; it can't work). */
1429  warningclass&
1430  operator=(warningclass other);
1431 
1432  cs_result report_impl(
1433  point p, const std::string &endbox,
1434  report_flags flags,
1435  const warning_retraction_info *ri,
1436  cs_warning_id *_id )
1437  {
1438  if( !inner )
1439  check(CS_ERROR_INVALID_PHASE_FOR_OPERATION);
1440  cs_warning_retraction_info_t _cri;
1441  cs_warning_retraction_info_t *cri =
1442  ri ? cglue<warning_retraction_info>::unwrap(*ri, &_cri)
1443  : NULL;
1444  cs_result r = csonar_report_warning(
1445  cglue<point>::unwrap(p),
1446  inner,
1447  endbox.c_str(),
1448  cglue<report_flags>::unwrap(flags),
1449  cri,
1450  _id );
1451  cglue<warning_retraction_info>::clean_unwrapped(cri);
1452  if( r == CS_ERROR_INVALID_ARGUMENT )
1453  check(r);
1454  return r;
1455  }
1456 
1457  cs_result report_impl(
1458  const std::vector<cs::cfg_path_node> &path,
1459  const warning_retraction_info *ri,
1460  cs_warning_id *_id )
1461  {
1462  if( !inner )
1463  check(CS_ERROR_INVALID_PHASE_FOR_OPERATION);
1464  cs_warning_retraction_info_t _cri;
1465  cs_warning_retraction_info_t *cri =
1466  ri ? cglue<warning_retraction_info>::unwrap(*ri, &_cri)
1467  : NULL;
1468  cs_cfg_path_node_t *cpath = new cs_cfg_path_node_t[path.size()];
1469  size_t i;
1470  for( i = 0; i < path.size(); i++ )
1471  cpath[i] = cglue<cfg_path_node>::unwrap(path[i]);
1472  cs_result r = csonar_report_path_warning(
1473  cpath,
1474  path.size(),
1475  inner,
1476  cri,
1477  _id );
1478  delete[] cpath;
1479  cglue<warning_retraction_info>::clean_unwrapped(cri);
1480  if( r == CS_ERROR_INVALID_ARGUMENT )
1481  check(r);
1482  return r;
1483  }
1484 
1485  cs_result report_impl(
1486  step_path path,
1487  const warning_retraction_info *ri,
1488  cs_warning_id *_id )
1489  {
1490  if( !inner )
1491  check(CS_ERROR_INVALID_PHASE_FOR_OPERATION);
1492  cs_warning_retraction_info_t _cri;
1493  cs_warning_retraction_info_t *cri =
1494  ri ? cglue<warning_retraction_info>::unwrap(*ri, &_cri)
1495  : NULL;
1496  cs_result r = csonar_report_step_path_warning(
1497  cglue<step_path>::unwrap(path),
1498  inner,
1499  cri,
1500  _id );
1501  cglue<warning_retraction_info>::clean_unwrapped(cri);
1502  if( r == CS_ERROR_INVALID_ARGUMENT )
1503  check(r);
1504  return r;
1505  }
1506 
1507  cs_result report_impl(
1508  sfileinst file,
1509  line_number line,
1510  const std::string &endbox,
1511  report_flags flags,
1512  const warning_retraction_info *ri,
1513  cs_warning_id *_id )
1514  {
1515  if( !inner )
1516  check(CS_ERROR_INVALID_PHASE_FOR_OPERATION);
1517  cs_warning_retraction_info_t _cri;
1518  cs_warning_retraction_info_t *cri =
1519  ri ? cglue<warning_retraction_info>::unwrap(*ri, &_cri)
1520  : NULL;
1521  cs_result r = csonar_report_location_warning(
1522  cglue<sfileinst>::unwrap(file),
1523  line,
1524  inner,
1525  endbox.c_str(),
1526  cglue<report_flags>::unwrap(flags),
1527  cri,
1528  _id );
1529  cglue<warning_retraction_info>::clean_unwrapped(cri);
1530  if( r == CS_ERROR_INVALID_ARGUMENT )
1531  check(r);
1532  return r;
1533  }
1534 
1535  cs_result report_impl(
1536  sfileinst file,
1537  line_number start_line,
1538  line_number end_line,
1539  column_number start_col,
1540  column_number end_col,
1541  const std::string &endbox,
1542  report_flags flags,
1543  const warning_retraction_info *ri,
1544  cs_warning_id *_id )
1545  {
1546  if( !inner )
1547  check(CS_ERROR_INVALID_PHASE_FOR_OPERATION);
1548  cs_warning_retraction_info_t _cri;
1549  cs_warning_retraction_info_t *cri =
1550  ri ? cglue<warning_retraction_info>::unwrap(*ri, &_cri)
1551  : NULL;
1552  cs_result r = csonar_report_location_span_warning(
1553  cglue<sfileinst>::unwrap(file),
1554  start_line, end_line,
1555  start_col, end_col,
1556  inner,
1557  endbox.c_str(),
1558  cglue<report_flags>::unwrap(flags),
1559  cri,
1560  _id );
1561  cglue<warning_retraction_info>::clean_unwrapped(cri);
1562  if( r == CS_ERROR_INVALID_ARGUMENT )
1563  check(r);
1564  return r;
1565  }
1566 
1567  cs_result report_impl(
1568  const std::vector<cs::locations_node> &path,
1569  const warning_retraction_info *ri,
1570  cs_warning_id *_id )
1571  {
1572  if( !inner )
1573  check(CS_ERROR_INVALID_PHASE_FOR_OPERATION);
1574  cs_warning_retraction_info_t _cri;
1575  cs_warning_retraction_info_t *cri =
1576  ri ? cglue<warning_retraction_info>::unwrap(*ri, &_cri)
1577  : NULL;
1578  cs_locations_node_t *cpath = new cs_locations_node_t[path.size()];
1579  size_t i;
1580  for( i = 0; i < path.size(); i++ )
1581  cpath[i] = cglue<locations_node>::unwrap(path[i]);
1582  cs_result r = csonar_report_locations_warning(
1583  cpath,
1584  path.size(),
1585  inner,
1586  cri,
1587  _id );
1588  delete[] cpath;
1589  cglue<warning_retraction_info>::clean_unwrapped(cri);
1590  if( r == CS_ERROR_INVALID_ARGUMENT )
1591  check(r);
1592  return r;
1593  }
1594 
1595  cs_result report_impl(
1596  sfileinst file,
1597  line_number line,
1598  procedure proc,
1599  const std::string &endbox,
1600  report_flags flags,
1601  const warning_retraction_info *ri,
1602  cs_warning_id *_id )
1603  {
1604  if( !inner )
1605  check(CS_ERROR_INVALID_PHASE_FOR_OPERATION);
1606  cs_warning_retraction_info_t _cri;
1607  cs_warning_retraction_info_t *cri =
1608  ri ? cglue<warning_retraction_info>::unwrap(*ri, &_cri)
1609  : NULL;
1610  cs_result r = csonar_report_location_warning_in_pdg(
1611  cglue<sfileinst>::unwrap(file),
1612  line,
1613  cglue<procedure>::unwrap(proc),
1614  inner,
1615  endbox.c_str(),
1616  cglue<report_flags>::unwrap(flags),
1617  cri,
1618  _id );
1619  cglue<warning_retraction_info>::clean_unwrapped(cri);
1620  if( r == CS_ERROR_INVALID_ARGUMENT )
1621  check(r);
1622  return r;
1623  }
1624 
1625  cs_result report_impl(
1626  sfileinst file,
1627  line_number start_line,
1628  line_number end_line,
1629  column_number start_col,
1630  column_number end_col,
1631  procedure proc,
1632  const std::string &endbox,
1633  report_flags flags,
1634  const warning_retraction_info *ri,
1635  cs_warning_id *_id )
1636  {
1637  if( !inner )
1638  check(CS_ERROR_INVALID_PHASE_FOR_OPERATION);
1639  cs_warning_retraction_info_t _cri;
1640  cs_warning_retraction_info_t *cri =
1641  ri ? cglue<warning_retraction_info>::unwrap(*ri, &_cri)
1642  : NULL;
1643  cs_result r = csonar_report_location_span_warning_in_pdg(
1644  cglue<sfileinst>::unwrap(file),
1645  start_line, end_line,
1646  start_col, end_col,
1647  cglue<procedure>::unwrap(proc),
1648  inner,
1649  endbox.c_str(),
1650  cglue<report_flags>::unwrap(flags),
1651  cri,
1652  _id );
1653  cglue<warning_retraction_info>::clean_unwrapped(cri);
1654  if( r == CS_ERROR_INVALID_ARGUMENT )
1655  check(r);
1656  return r;
1657  }
1658 
1659  cs_result report_impl(
1660  const std::vector<cs::locations_node> &path,
1661  procedure proc,
1662  const warning_retraction_info *ri,
1663  cs_warning_id *_id )
1664  {
1665  if( !inner )
1666  check(CS_ERROR_INVALID_PHASE_FOR_OPERATION);
1667  cs_warning_retraction_info_t _cri;
1668  cs_warning_retraction_info_t *cri =
1669  ri ? cglue<warning_retraction_info>::unwrap(*ri, &_cri)
1670  : NULL;
1671  cs_locations_node_t *cpath = new cs_locations_node_t[path.size()];
1672  size_t i;
1673  for( i = 0; i < path.size(); i++ )
1674  cpath[i] = cglue<locations_node>::unwrap(path[i]);
1675  cs_result r = csonar_report_locations_warning_in_pdg(
1676  cglue<procedure>::unwrap(proc),
1677  cpath,
1678  path.size(),
1679  inner,
1680  cri,
1681  _id );
1682  delete[] cpath;
1683  cglue<warning_retraction_info>::clean_unwrapped(cri);
1684  if( r == CS_ERROR_INVALID_ARGUMENT )
1685  check(r);
1686  return r;
1687  }
1688 
1689  cs_result report_impl(
1690  sfileinst file,
1691  const std::string &endbox,
1692  report_flags flags,
1693  const warning_retraction_info *ri,
1694  cs_warning_id *_id )
1695  {
1696  if( !inner )
1697  check(CS_ERROR_INVALID_PHASE_FOR_OPERATION);
1698  cs_warning_retraction_info_t _cri;
1699  cs_warning_retraction_info_t *cri =
1700  ri ? cglue<warning_retraction_info>::unwrap(*ri, &_cri)
1701  : NULL;
1702  cs_result r = csonar_report_file_warning(
1703  cglue<sfileinst>::unwrap(file),
1704  inner,
1705  endbox.c_str(),
1706  cglue<report_flags>::unwrap(flags),
1707  cri,
1708  _id );
1709  cglue<warning_retraction_info>::clean_unwrapped(cri);
1710  if( r == CS_ERROR_INVALID_ARGUMENT )
1711  check(r);
1712  return r;
1713  }
1714 
1715  cs_result report_impl(
1716  const std::string &endbox,
1717  report_flags flags,
1718  cs_warning_id *_id )
1719  {
1720  if( !inner )
1721  check(CS_ERROR_INVALID_PHASE_FOR_OPERATION);
1722  cs_result r = csonar_report_analysis_warning(
1723  inner,
1724  endbox.c_str(),
1725  cglue<report_flags>::unwrap(flags),
1726  _id );
1727  if( r == CS_ERROR_INVALID_ARGUMENT )
1728  check(r);
1729  return r;
1730  }
1731 
1732  /* This constructor is not public because the destructor does
1733  * not "reverse" its actions.
1734  */
1735  warningclass(const std::string &_name,
1736  const std::string &categories,
1737  double rank,
1738  warningclass_flags flags,
1739  warning_significance significance)
1740  : inner(NULL)
1741  , factory(NULL)
1742  {
1743  cs_result r = csonar_create_warningclass_ex(
1744  _name.c_str(), categories.c_str(),
1745  rank,
1746  cglue<warningclass_flags>::unwrap(flags),
1747  cglue<warning_significance>::unwrap(significance),
1748  &inner );
1749  switch( r )
1750  {
1751  case CS_SUCCESS:
1752  case CS_ELEMENT_ALREADY_PRESENT:
1753  break;
1754  case CS_ERROR_SDG_NOT_PRESENT:
1755  factory = new delay_factory(
1756  _name, categories,
1757  rank, flags, significance,
1758  this );
1759  break;
1760  default:
1761  check(r);
1762  }
1763  }
1764 
1765  warningclass(const std::string &_name)
1766  : inner(NULL)
1767  , factory(NULL)
1768  {
1769  check(csonar_warningclass_lookup_by_name(
1770  _name.c_str(),
1771  &inner ));
1772  }
1773 
1774  warningclass(csuint32 _id)
1775  : inner(NULL)
1776  , factory(NULL)
1777  {
1778  check(csonar_warningclass_lookup(_id, &inner));
1779  }
1780 
1781  public:
1782 
1793  warningclass(const warningclass &other)
1794  : inner(other.inner)
1795  , factory(NULL)
1796  {
1797  if( !inner )
1798  {
1799  factory = new delay_factory(
1800  *other.factory, this );
1801  }
1802  }
1803 
1804  ~warningclass()
1805  {
1806  if( factory )
1807  factory->abandon();
1808  }
1809  \
1820  int cmp(const warningclass &other) const
1821  { return name().compare(other.name()); }
1822 
1823 
1828  CS_BOILERPLATE_HASH_TYPE hash() const
1829  {
1830  /* hash by name in order that the hash will work and
1831  * remain static even when !inner.
1832  */
1833  return static_cast<cs_hash_t>(
1834  cs_xref_namehash(name().c_str()));
1835  }
1836 
1846  csuint32 id() const
1847  {
1848  if( !inner )
1849  check(CS_ERROR_INVALID_ARGUMENT);
1850  return csonar_warningclass_id(inner);
1851  }
1852 
1867  bool always_discarded() const
1868  {
1869  if( !inner )
1870  check(CS_ERROR_INVALID_ARGUMENT);
1871  return !!csonar_warningclass_always_discarded(inner);
1872  }
1873 
1889  bool allowed() const
1890  {
1891  if( !inner )
1892  check(CS_ERROR_INVALID_ARGUMENT);
1893  return !!csonar_warningclass_allowed(inner);
1894  }
1895 
1896 #if defined(SWIG) && defined(SWIGPYTHON)
1897  %feature("shadow") report %{
1898  def report(self, *args):
1899  # workaround SWIGs inability to disambiguate vectors of different types
1900  try:
1901  is_loc = isinstance(args[0][0], locations_node)
1902  except Exception:
1903  is_loc = False
1904  if is_loc:
1905  return self._report_locations(*args)
1906  else:
1907  return $action(self, *args)%}
1908  %feature("shadow") report_return_warning %{
1909  def report_return_warning(self, *args):
1910  # workaround SWIGs inability to disambiguate vectors of different types
1911  try:
1912  is_loc = isinstance(args[0][0], locations_node)
1913  except Exception:
1914  is_loc = False
1915  if is_loc:
1916  return self._report_locations_return_warning(*args)
1917  else:
1918  return $action(self, *args)%}
1919 #endif
1920 
1921 
1922 
1923  /* Retraction cases
1924  * Do not turn into a Doxygen-style comment.
1925  * Do not add per-line asterisks.
1926 
1927  [retract_ri]
1928 
1929  The warning will be automatically retracted in a subsequent
1930  incremental analysis if and only if one or more of the
1931  conditions expressed in \p ri is satisfied.
1932 
1933  [retract_ri]
1934 
1935 
1936  [retract_mod_proc_cont_p]
1937 
1938  The warning will be automatically retracted in a subsequent
1939  incremental analysis if and only if the \ref procedure
1940  containing \p p has been modified.
1941 
1942  [retract_mod_proc_cont_p]
1943 
1944 
1945  [retract_mod_proc_cont_p_first]
1946 
1947  The warning will be automatically retracted in a subsequent
1948  incremental analysis if and only if the \ref procedure
1949  containing the first point in \p p has been modified.
1950 
1951  [retract_mod_proc_cont_p_first]
1952 
1953 
1954  [retract_mod_cu_cont_file]
1955 
1956  The warning will be automatically retracted in a subsequent
1957  incremental analysis if and only if the \ref compunit
1958  containing \p file has been modified.
1959 
1960  [retract_mod_cu_cont_file]
1961 
1962 
1963  [retract_mod_cu_cont_p_first]
1964 
1965  The warning will be automatically retracted in a subsequent
1966  incremental analysis if and only if the \ref compunit
1967  containing the first location in p has been modified.
1968 
1969  [retract_mod_cu_cont_p_first]
1970 
1971 
1972  [retract_always]
1973 
1974  The warning will be always be automatically retracted during
1975  an incremental build, since the warning is against the entire
1976  analysis.
1977 
1978  [retract_always]
1979 
1980  */
1981 
1982  /* BY POINT */
1983 
1984  /*
1985  * base result and exception lists for reporting functions.
1986  * Do not turn into a Doxygen-style comment.
1987  * Do not add per-line asterisks.
1988  [basic_return]
1989  @return A \ref result, as follows:
1990  - result::SUCCESS if the warning was successfully
1991  queued for submission to the hub.
1992  - result::FILTERED_OUT if the warning was not submitted to
1993  the hub because it matched a \c WARNING_FILTER
1994  discard rule in the configuration file.
1995  - result::TIMEOUT if the time limit specified by
1996  configuration file option \c TIME_LIMIT_RENDER
1997  expired.
1998  - result::NO_SOURCE_CORRESPONDENCE if the warning was not
1999  submitted to the hub because no source location for the
2000  warning could be determined.
2001  - result::ELEMENT_ALREADY_PRESENT if the warning was not
2002  submitted to the hub because configuration file option
2003  \c REPORT_SIMILAR_WARNINGS is set to \c No and a
2004  similar warning was previously submitted.
2005 
2006 
2007  @exception result::ERROR_INVALID_PHASE_FOR_OPERATION if
2008  called from a drop visitor,
2009  \@CPPSTART\@ \c %cs_plug_main(), \@CPPEND\@
2010  or your plug-in's top-level scope.
2011 
2012  [basic_return]
2013 
2014  [basic_exceptions]
2015  @exception result::FILTERED_OUT if the warning was not
2016  submitted to the hub because it matched a \c WARNING_FILTER
2017  discard rule in the configuration file.
2018 
2019  @exception result::TIMEOUT if the time limit specified by
2020  configuration file option \c TIME_LIMIT_RENDER expired.
2021 
2022  @exception result::NO_SOURCE_CORRESPONDENCE if the warning
2023  was not submitted to the hub because no source location for
2024  the warning could be determined.
2025 
2026  @exception result::ELEMENT_ALREADY_PRESENT if the warning was
2027  not submitted to the hub because configuration file option \c
2028  REPORT_SIMILAR_WARNINGS is set to \c No and a similar warning
2029  was previously submitted.
2030 
2031  @exception result::ERROR_INVALID_PHASE_FOR_OPERATION if
2032  called from a drop visitor,
2033  \@CPPSTART\@ \c %cs_plug_main(), \@CPPEND\@
2034  or your plug-in's top-level scope.
2035 
2036  [basic_exceptions]
2037 
2038  */
2039 
2040 
2061  result report( point p,
2062  const std::string &endbox,
2063  report_flags flags = report_flags::NONE )
2064  { return cglue<result>::wrap(report_impl( p, endbox.c_str(), flags, NULL, NULL )); }
2065 
2066 
2094  warning report_return_warning( point p, const std::string &endbox,
2096  {
2097  cs_warning_id wid;
2098  check(report_impl( p, endbox.c_str(), flags, NULL, &wid ));
2099  return warning::;
2100  }
2101 
2102 
2103 
2130  result report( point p,
2131  const std::string &endbox,
2132  report_flags flags,
2133  const warning_retraction_info &ri )
2134  { return cglue<result>::wrap(report_impl( p, endbox.c_str(), flags, &ri, NULL )); }
2135 
2136 
2169  warning report_return_warning( point p, const std::string &endbox,
2170  report_flags flags,
2171  const warning_retraction_info &ri )
2172  {
2173  cs_warning_id wid;
2174  check(report_impl( p, endbox.c_str(), flags, &ri, &wid ));
2175  return warning::;
2176  }
2177 
2178 
2179  /* BY PATH */
2180 
2181  /*
2182  * result and exception lists for reporting functions that take a path.
2183  * Do not turn into a Doxygen-style comment.
2184  * Do not add per-line asterisks.
2185  [path_return]
2186  @return A \ref result, as follows:
2187  - result::SUCCESS if the warning was successfully
2188  queued for submission to the hub.
2189  - result::FILTERED_OUT if the warning was not submitted to
2190  the hub because it matched a \c WARNING_FILTER
2191  discard rule in the configuration file.
2192  - result::TIMEOUT if the time limit specified by
2193  configuration file option \c TIME_LIMIT_RENDER
2194  expired.
2195  - result::NO_SOURCE_CORRESPONDENCE if the warning was not
2196  submitted to the hub because no source location for the
2197  warning could be determined.
2198  - result::ELEMENT_ALREADY_PRESENT if the warning was not
2199  submitted to the hub because configuration file option
2200  \c REPORT_SIMILAR_WARNINGS is set to \c No and a
2201  similar warning was previously submitted.
2202 
2203 
2204  @exception result::ERROR_INVALID_PHASE_FOR_OPERATION if
2205  called from a drop visitor,
2206  \@CPPSTART\@ \c %cs_plug_main(), \@CPPEND\@
2207  or your plug-in's top-level scope.
2208 
2209  @exception result::ERROR_INVALID_ARGUMENT if path argument \p p is
2210  empty.
2211 
2212  [path_return]
2213 
2214  [path_exceptions]
2215  @exception result::FILTERED_OUT if the warning was not
2216  submitted to the hub because it matched a \c WARNING_FILTER
2217  discard rule in the configuration file.
2218 
2219  @exception result::TIMEOUT if the time limit specified by
2220  configuration file option \c TIME_LIMIT_RENDER expired.
2221 
2222  @exception result::NO_SOURCE_CORRESPONDENCE if the warning
2223  was not submitted to the hub because no source location for
2224  the warning could be determined.
2225 
2226  @exception result::ELEMENT_ALREADY_PRESENT if the warning was
2227  not submitted to the hub because configuration file option \c
2228  REPORT_SIMILAR_WARNINGS is set to \c No and a similar warning
2229  was previously submitted.
2230 
2231  @exception result::ERROR_INVALID_PHASE_FOR_OPERATION if
2232  called from a drop visitor,
2233  \@CPPSTART\@ \c %cs_plug_main(), \@CPPEND\@
2234  or your plug-in's top-level scope.
2235 
2236  @exception result::ERROR_INVALID_ARGUMENT if path argument \p p is
2237  empty.
2238 
2239  [path_exceptions]
2240  */
2241 
2256  result report( const std::vector<cs::cfg_path_node> &p )
2257  { return cglue<result>::wrap(report_impl( p, NULL, NULL )); }
2258 
2259 
2281  warning report_return_warning( const std::vector<cs::cfg_path_node> &p )
2282  {
2283  cs_warning_id wid;
2284  check(report_impl( p, NULL, &wid ));
2285  return warning::;
2286  }
2287 
2288 
2303  result report( const std::vector<cs::cfg_path_node> &p,
2304  const warning_retraction_info &ri )
2305  { return cglue<result>::wrap(report_impl( p, &ri, NULL )); }
2307 
2334  warning report_return_warning( const std::vector<cs::cfg_path_node> &p,
2335  const warning_retraction_info &ri )
2336  {
2337  cs_warning_id wid;
2338  check(report_impl( p, &ri, &wid ));
2339  return warning::;
2340  }
2341 
2342 
2343  /* BY STEP_PATH */
2344 
2345 
2359  result report( step_path p )
2360  { return cglue<result>::wrap(report_impl( p, NULL, NULL )); }
2361 
2362 
2384  warning report_return_warning( step_path p )
2385  {
2386  cs_warning_id wid;
2387  check(report_impl( p, NULL, &wid ));
2388  return warning::;
2389  }
2390 
2391 
2411  result report( step_path p,
2412  const warning_retraction_info &ri )
2413  { return cglue<result>::wrap(report_impl( p, &ri, NULL )); }
2414 
2415 
2442  warning report_return_warning( step_path p,
2443  const warning_retraction_info &ri )
2444  {
2445  cs_warning_id wid;
2446  check(report_impl( p, &ri, &wid ));
2447  return warning::;
2448  }
2449 
2450  /* BY LOCATION */
2451  /*
2452  * extra result and exception lists for 'by location' functions.
2453  * Do not turn into a Doxygen-style comment.
2454  * Do not add per-line asterisks.
2455  [by_location_return]
2456  @return A \ref result, as follows:
2457  - result::SUCCESS if the warning was successfully
2458  queued for submission to the hub.
2459  - result::FILTERED_OUT if the warning was not submitted to
2460  the hub because it matched a \c WARNING_FILTER
2461  discard rule in the configuration file.
2462  - result::TIMEOUT if the time limit specified by
2463  configuration file option \c TIME_LIMIT_RENDER
2464  expired.
2465  - result::NO_SOURCE_CORRESPONDENCE if the warning was not
2466  submitted to the hub because no source location for the
2467  warning could be determined.
2468  - result::ELEMENT_ALREADY_PRESENT if the warning was not
2469  submitted to the hub because configuration file option
2470  \c REPORT_SIMILAR_WARNINGS is set to \c No and a
2471  similar warning was previously submitted.
2472 
2473 
2474  @exception result::ERROR_INVALID_ARGUMENT if warnings of this
2475  class have associated paths (and should therefore be reported
2476  with those paths) or, for the versions that accept spans, if
2477  the span is malformed.
2478 
2479  @exception result::ERROR_INVALID_PHASE_FOR_OPERATION if
2480  called from a drop visitor,
2481  \@CPPSTART\@ \c %cs_plug_main(), \@CPPEND\@
2482  or your plug-in's top-level scope.
2483  [by_location_return]
2484 
2485  [by_location_exceptions]
2486  @exception result::FILTERED_OUT if the warning was not
2487  submitted to the hub because it matched a \c WARNING_FILTER
2488  discard rule in the configuration file.
2489 
2490  @exception result::TIMEOUT if the time limit specified by
2491  configuration file option \c TIME_LIMIT_RENDER expired.
2492 
2493  @exception result::NO_SOURCE_CORRESPONDENCE if the warning
2494  was not submitted to the hub because no source location for
2495  the warning could be determined.
2496 
2497  @exception result::ELEMENT_ALREADY_PRESENT if the warning was
2498  not submitted to the hub because configuration file option \c
2499  REPORT_SIMILAR_WARNINGS is set to \c No and a similar warning
2500  was previously submitted.
2501 
2502  @exception result::ERROR_INVALID_ARGUMENT if warnings of this
2503  class have associated paths (and should therefore be
2504  reported with those paths).
2505 
2506  @exception result::ERROR_INVALID_PHASE_FOR_OPERATION if
2507  called from a drop visitor,
2508  \@CPPSTART\@ \c %cs_plug_main(), \@CPPEND\@
2509  or your plug-in's top-level scope.
2510  [by_location_exceptions]
2511  */
2512 
2540  result report( sfileinst file,
2541  line_number line,
2542  const std::string &endbox,
2544  { return cglue<result>::wrap(report_impl( file, line, endbox.c_str(), flags, NULL, NULL )); }
2545 
2546 
2580  warning report_return_warning( sfileinst file, line_number line,
2581  const std::string &endbox,
2583  {
2584  cs_warning_id wid;
2585  check(report_impl( file, line, endbox.c_str(), flags, NULL, &wid ));
2586  return warning::;
2587  }
2588 
2589 
2621  result report( sfileinst file,
2622  line_number line,
2623  const std::string &endbox,
2624  report_flags flags,
2625  const warning_retraction_info &ri )
2626  { return cglue<result>::wrap(report_impl( file, line, endbox.c_str(), flags, &ri, NULL )); }
2627 
2628 
2667  warning report_return_warning( sfileinst file,
2668  line_number line,
2669  const std::string &endbox,
2670  report_flags flags,
2671  const warning_retraction_info &ri )
2672  {
2673  cs_warning_id wid;
2674  check(report_impl( file, line, endbox.c_str(), flags, &ri, &wid ));
2675  return warning::;
2676  }
2677 
2714  result report( sfileinst file,
2715  line_number start_line,
2716  line_number end_line,
2717  column_number start_col,
2718  column_number end_col,
2719  const std::string &endbox,
2720  report_flags flags = report_flags::NONE )
2721  { return cglue<result>::wrap(report_impl( file, start_line, end_line, start_col, end_col, endbox.c_str(), flags, NULL, NULL )); }
2722 
2723 
2766  warning report_return_warning( sfileinst file, line_number start_line,
2767  line_number end_line,
2768  column_number start_col,
2769  column_number end_col,
2770  const std::string &endbox,
2771  report_flags flags = report_flags::NONE )
2772  {
2773  cs_warning_id wid;
2774  check(report_impl( file, start_line, end_line, start_col, end_col,
2775  endbox.c_str(), flags, NULL, &wid ));
2776  return warning::;
2777  }
2778 
2779 
2820  result report( sfileinst file,
2821  line_number start_line,
2822  line_number end_line,
2823  column_number start_col,
2824  column_number end_col,
2825  const std::string &endbox,
2826  report_flags flags,
2827  const warning_retraction_info &ri )
2828  { return cglue<result>::wrap(report_impl( file, start_line, end_line, start_col, end_col, endbox.c_str(), flags, &ri, NULL )); }
2829 
2830 
2878  warning report_return_warning( sfileinst file,
2879  line_number start_line,
2880  line_number end_line,
2881  column_number start_col,
2882  column_number end_col,
2883  const std::string &endbox,
2884  report_flags flags,
2885  const warning_retraction_info &ri )
2886  {
2887  cs_warning_id wid;
2888  check(report_impl( file, start_line, end_line, start_col, end_col,
2889  endbox.c_str(), flags, &ri, &wid ));
2890  return warning::;
2891  }
2892 
2893 #ifdef SWIGPYTHON
2894  /* Alas, swig is not smart enough to distinguish this and the
2895  * cfg_node_path vector overloads because they are both
2896  * iterables as far as it is concerned when doing python. So
2897  * we rename this one.
2898  */
2899 #define report _report_locations
2900 #define report_return_warning _report_locations_return_warning
2901 #endif
2902 
2903  /* BY LOCATIONS */
2904 
2905  /*
2906  * extra result and exception lists for 'by location' functions.
2907  * Do not turn into a Doxygen-style comment.
2908  * Do not add per-line asterisks.
2909  [by_locations_return]
2910  @return A \ref result, as follows:
2911  - result::SUCCESS if the warning was successfully
2912  queued for submission to the hub.
2913  - result::FILTERED_OUT if the warning was not submitted to
2914  the hub because it matched a \c WARNING_FILTER
2915  discard rule in the configuration file.
2916  - result::TIMEOUT if the time limit specified by
2917  configuration file option \c TIME_LIMIT_RENDER
2918  expired.
2919  - result::NO_SOURCE_CORRESPONDENCE if the warning was not
2920  submitted to the hub because no source location for the
2921  warning could be determined.
2922  - result::ELEMENT_ALREADY_PRESENT if the warning was not
2923  submitted to the hub because configuration file option
2924  \c REPORT_SIMILAR_WARNINGS is set to \c No and a
2925  similar warning was previously submitted.
2926 
2927 
2928  @exception result::ERROR_INVALID_ARGUMENT if warnings of this
2929  class have associated paths (and should therefore be reported
2930  with those paths), or if \p p is empty.
2931 
2932  @exception result::ERROR_INVALID_PHASE_FOR_OPERATION if
2933  called from a drop visitor,
2934  \@CPPSTART\@ \c %cs_plug_main(), \@CPPEND\@
2935  or your plug-in's top-level scope.
2936  [by_locations_return]
2937 
2938  [by_locations_exceptions]
2939  @exception result::FILTERED_OUT if the warning was not
2940  submitted to the hub because it matched a \c WARNING_FILTER
2941  discard rule in the configuration file.
2942 
2943  @exception result::TIMEOUT if the time limit specified by
2944  configuration file option \c TIME_LIMIT_RENDER expired.
2945 
2946  @exception result::NO_SOURCE_CORRESPONDENCE if the warning
2947  was not submitted to the hub because no source location for
2948  the warning could be determined.
2949 
2950  @exception result::ELEMENT_ALREADY_PRESENT if the warning was
2951  not submitted to the hub because configuration file option \c
2952  REPORT_SIMILAR_WARNINGS is set to \c No and a similar warning
2953  was previously submitted.
2954 
2955  @exception result::ERROR_INVALID_ARGUMENT if warnings of this
2956  class have associated paths (and should therefore be reported
2957  with those paths), or if \p p is empty.
2958 
2959  @exception result::ERROR_INVALID_PHASE_FOR_OPERATION if
2960  called from a drop visitor,
2961  \@CPPSTART\@ \c %cs_plug_main(), \@CPPEND\@
2962  or your plug-in's top-level scope.
2963  [by_locations_exceptions]
2964  */
2965 
2981  result report( const std::vector<cs::locations_node> &p )
2982  { return cglue<result>::wrap(report_impl( p, NULL, NULL )); }
2983 
2984 
3006  warning report_return_warning( const std::vector<cs::locations_node> &p )
3007  {
3008  cs_warning_id wid;
3009  check(report_impl( p, NULL, &wid ));
3010  return warning::;
3011  }
3012 
3013 
3033  result report( const std::vector<cs::locations_node> &p,
3034  const warning_retraction_info &ri )
3035  { return cglue<result>::wrap(report_impl( p, &ri, NULL )); }
3036 
3037 
3064  warning report_return_warning( const std::vector<cs::locations_node> &p,
3065  const warning_retraction_info &ri )
3066  {
3067  cs_warning_id wid;
3068  check(report_impl( p, &ri, &wid ));
3069  return warning::;
3070  }
3071 
3072 
3073 #ifdef SWIGPYTHON
3074 #undef report
3075 #undef report_return_warning
3076 #endif
3077 
3078  /* BY LOCATION IN A PROCEDURE */
3079 
3080 
3108  result report( sfileinst file,
3109  line_number line,
3110  procedure proc,
3111  const std::string &endbox,
3112  report_flags flags = report_flags::NONE )
3113  { return cglue<result>::wrap(report_impl( file, line, proc, endbox.c_str(), flags, NULL, NULL )); }
3114 
3115 
3149  warning report_return_warning( sfileinst file,
3150  line_number line,
3151  procedure proc,
3152  const std::string &endbox,
3153  report_flags flags
3154  = report_flags::NONE )
3155  {
3156  cs_warning_id wid;
3157  check(report_impl( file, line, proc, endbox.c_str(), flags, NULL,
3158  &wid ));
3159  return warning::;
3160  }
3161 
3162 
3199  result report( sfileinst file,
3200  line_number start_line,
3201  line_number end_line,
3202  column_number start_col,
3203  column_number end_col,
3204  procedure proc,
3205  const std::string &endbox,
3206  report_flags flags = report_flags::NONE )
3207  { return cglue<result>::wrap(report_impl( file, start_line, end_line,
3208  start_col, end_col, proc,
3209  endbox.c_str(), flags, NULL,
3210  NULL )); }
3211 
3212 
3255  warning report_return_warning( sfileinst file,
3256  line_number start_line,
3257  line_number end_line,
3258  column_number start_col,
3259  column_number end_col,
3260  procedure proc,
3261  const std::string &endbox,
3262  report_flags flags
3263  = report_flags::NONE )
3264  {
3265  cs_warning_id wid;
3266  check(report_impl( file, start_line, end_line, start_col, end_col,
3267  proc, endbox.c_str(), flags, NULL, &wid ));
3268  return warning::;
3269  }
3270 
3302  result report( sfileinst file,
3303  line_number line,
3304  procedure proc,
3305  const std::string &endbox,
3306  report_flags flags,
3307  const warning_retraction_info &ri )
3308  { return cglue<result>::wrap(report_impl( file, line, proc, endbox.c_str(), flags, &ri, NULL )); }
3309 
3310 
3349  warning report_return_warning( sfileinst file,
3350  line_number line,
3351  procedure proc,
3352  const std::string &endbox,
3353  report_flags flags,
3354  const warning_retraction_info &ri )
3355  {
3356  cs_warning_id wid;
3357  check(report_impl( file, line, proc, endbox.c_str(), flags, &ri,
3358  &wid ));
3359  return warning::;
3360  }
3361 
3362 
3406  result report( sfileinst file,
3407  line_number start_line,
3408  line_number end_line,
3409  column_number start_col,
3410  column_number end_col,
3411  procedure proc,
3412  const std::string &endbox,
3413  report_flags flags,
3414  const warning_retraction_info &ri )
3415  {
3416  return cglue<result>::wrap(report_impl( file, start_line, end_line,
3417  start_col, end_col, proc,
3418  endbox.c_str(), flags, &ri,
3419  NULL ));
3420  }
3421 
3422 
3470  warning report_return_warning( sfileinst file,
3471  line_number start_line,
3472  line_number end_line,
3473  column_number start_col,
3474  column_number end_col,
3475  procedure proc,
3476  const std::string &endbox,
3477  report_flags flags,
3478  const warning_retraction_info &ri )
3479  {
3480  cs_warning_id wid;
3481  check(report_impl( file, start_line, end_line, start_col, end_col,
3482  proc, endbox.c_str(), flags, &ri, &wid ));
3483  return warning::;
3484  }
3485 
3486 
3487 #ifdef SWIGPYTHON
3488  /* Alas, swig is not smart enough to distinguish this and the
3489  * cfg_node_path vector overloads because they are both
3490  * iterables as far as it is concerned when doing python. So
3491  * we rename this one.
3492  */
3493 #define report _report_locations
3494 #define report_return_warning _report_locations_return_warning
3495 #endif
3496 
3497 
3498  /* BY LOCATIONS IN A PROCEDURE */
3517  result report( const std::vector<cs::locations_node> &p, procedure proc )
3518  { return cglue<result>::wrap(report_impl( p, proc, NULL, NULL )); }
3519 
3520 
3546  warning report_return_warning( const std::vector<cs::locations_node> &p,
3547  procedure proc )
3548  {
3549  cs_warning_id wid;
3550  check(report_impl( p, proc, NULL, &wid ));
3551  return warning::;
3552  }
3553 
3554 
3578  result report( const std::vector<cs::locations_node> &p,
3579  procedure proc,
3580  const warning_retraction_info &ri )
3581  { return cglue<result>::wrap(report_impl( p, proc, &ri, NULL )); }
3582 
3583 
3614  warning report_return_warning( const std::vector<cs::locations_node> &p,
3615  procedure proc,
3616  const warning_retraction_info &ri )
3617  {
3618  cs_warning_id wid;
3619  check(report_impl( p, proc, &ri, &wid ));
3620  return warning::;
3621  }
3622 
3623 
3624 #ifdef SWIGPYTHON
3625 #undef report
3626 #undef report_return_warning
3627 #endif
3628 
3629  /* BY FILE */
3630 
3650  result report( sfileinst file,
3651  const std::string &endbox,
3652  report_flags flags = report_flags::NONE )
3653  { return cglue<result>::wrap(report_impl( file, endbox.c_str(), flags, NULL, NULL )); }
3654 
3655 
3682  warning report_return_warning( sfileinst file, const std::string &endbox,
3683  report_flags flags = report_flags::NONE )
3684  {
3685  cs_warning_id wid;
3686  check(report_impl( file, endbox.c_str(), flags, NULL, &wid ));
3687  return warning::;
3688  }
3689 
3713  result report( sfileinst file,
3714  const std::string &endbox,
3715  report_flags flags,
3716  const warning_retraction_info &ri )
3717  { return cglue<result>::wrap(report_impl( file, endbox.c_str(), flags, &ri, NULL )); }
3718 
3719 
3750  warning report_return_warning( sfileinst file, const std::string &endbox,
3751  report_flags flags,
3752  const warning_retraction_info &ri )
3753  {
3754  cs_warning_id wid;
3755  check(report_impl( file, endbox.c_str(), flags, &ri, &wid ));
3756  return warning::;
3757  }
3758 
3759 
3760  /* GLOBAL */
3761  /*
3762  * result and exception lists for the 'by pathpoint' functions.
3763  * Do not turn into a Doxygen-style comment.
3764  * Do not add per-line asterisks.
3765  [by_global_return]
3766  @return A \ref result, as follows:
3767  - result::SUCCESS if the warning was successfully
3768  queued for submission to the hub.
3769  - result::FILTERED_OUT if the warning was not submitted
3770  to the hub because it matched a \c WARNING_FILTER
3771  discard rule in the configuration file.
3772  - result::TIMEOUT if the time limit specified by
3773  configuration file option \c TIME_LIMIT_RENDER
3774  expired.
3775  - result::ELEMENT_ALREADY_PRESENT if the warning was not
3776  submitted to the hub because configuration file option
3777  \c REPORT_SIMILAR_WARNINGS is set to \c No and a
3778  similar warning was previously submitted.
3779 
3780 
3781  @exception result::ERROR_INVALID_ARGUMENT if warnings of this
3782  class have associated paths (and should therefore be reported
3783  with those paths).
3784 
3785  @exception result::ERROR_INVALID_PHASE_FOR_OPERATION if
3786  called from a drop visitor,
3787  \@CPPSTART\@ \c %cs_plug_main(), \@CPPEND\@
3788  or your plug-in's top-level scope.
3789 
3790  [by_global_return]
3791 
3792  [by_global_exceptions]
3793  @exception result::ERROR_INVALID_ARGUMENT if warnings of this
3794  class have associated paths (and should therefore be
3795  reported with those paths).
3796 
3797  @exception result::FILTERED_OUT if the warning was not
3798  submitted to the hub because it matched a \c WARNING_FILTER
3799  discard rule in the configuration file.
3800 
3801  @exception result::TIMEOUT if the time limit specified by
3802  configuration file option \c TIME_LIMIT_RENDER expired.
3803 
3804  @exception result::ELEMENT_ALREADY_PRESENT if the warning was
3805  not submitted to the hub because configuration file option
3806  \c REPORT_SIMILAR_WARNINGS is set to \c No and a similar
3807  warning was previously submitted.
3808 
3809  @exception result::ERROR_INVALID_PHASE_FOR_OPERATION if
3810  called from a drop visitor,
3811  \@CPPSTART\@ \c %cs_plug_main(), \@CPPEND\@
3812  or your plug-in's top-level scope.
3813 
3814  [by_global_exceptions]
3815  */
3816 
3834  result report( const std::string &endbox,
3836  { return cglue<result>::wrap(report_impl( endbox.c_str(), flags, NULL )); }
3837 
3838 
3863  warning report_return_warning( const std::string &endbox,
3865  {
3866  cs_warning_id wid;
3867  check(report_impl( endbox.c_str(), flags, &wid ));
3868  return warning::;
3869  }
3870 
3871 
3876  std::string name() const
3877  {
3878  if( !inner )
3879  return factory->get_name();
3880  return csonar_warningclass_name(inner);
3881  }
3882 
3885  std::string as_repr() const
3886  { return CS_AS_REPR_FROM_STRING(warningclass); }
3887 
3890  std::string as_string() const
3891  { return name(); }
3892 
3893  SWIG_BUILD_ONLY(
3894  bool operator==(const warningclass& other)
3895  { return cmp(other) == 0; }
3896  bool operator!=(const warningclass& b)
3897  { return cmp(b) != 0; }
3898  bool operator<(const warningclass& b)
3899  { return cmp(b) < 0; }
3900  bool operator<=(const warningclass& b)
3901  { return cmp(b) <= 0; }
3902  bool operator>(const warningclass& b)
3903  { return cmp(b) > 0; }
3904  bool operator>=(const warningclass& b)
3905  { return cmp(b) >= 0; } )
3906  };
3907  CS_IR_BOILERPLATE_NONMEMBERS(warningclass, cs);
3908 
3909  NOT_SWIG_BUILD_ONLY(
3918  inline bool operator==(const warningclass& a, const warningclass& b)
3919  { return a.cmp(b) == 0; }
3927  inline bool operator!=(const warningclass& a, const warningclass& b)
3928  { return a.cmp(b) != 0; }
3929 
3933  inline bool operator<(const warningclass& a, const warningclass& b)
3934  { return a.cmp(b) < 0; }
3935 
3939  inline bool operator<=(const warningclass& a, const warningclass& b)
3940  { return a.cmp(b) <= 0; }
3941 
3945  inline bool operator>(const warningclass& a, const warningclass& b)
3946  { return a.cmp(b) > 0; }
3947 
3951  inline bool operator>=(const warningclass& a, const warningclass& b)
3952  { return a.cmp(b) >= 0; } )
3953 
3954  template<>
3955  class cglue<warningclass>
3956  {
3957  friend class warningclass;
3958  cglue();
3959  public:
3960  typedef cs_warningclass_t ctype;
3961  typedef warningclass type;
3962  CS_CXX_API_CGLUE_ACCESS_MODIFIER:
3963 
3964  static ctype unwrap(const type &c)
3965  { return c.unwrap(); }
3966  };
3967 }
3968 
3969 #endif /* CSONAR_WARNINGCLASS_H */
static const locations_node_flags ALTERNATE_INTERESTING
Singleton set containing the "alternate interesting" flag: this location should be rendered in the "a...
Definition: csonar_warningclass.hpp:226
cs_line line_number
A line number in a source file (sfile) or source file instance (sfileinst).
Definition: cs_types.hpp:387
Denotes the conditions under which control can flow along an edge: a component of a cfg_edge...
Definition: cs_edge_label.hpp:57
static const cfg_path_node_flags ALREADY_XML_ENCODED
Special characters such as &#39;<&#39; and &#39;>&#39; are already XML-escaped in the &#39;problem&#39; string.
Definition: csonar_warningclass.hpp:88
static const report_flags NONE
Use this if you don&#39;t want any other flags.
Definition: csonar_warningclass.hpp:40
static const locations_node_flags ALREADY_XML_ENCODED
Singleton set containing the "already XML encoded" flag: special characters such as &#39;<&#39; and &#39;>&#39; are a...
Definition: csonar_warningclass.hpp:173
Namespace for CodeSonar/CodeSurfer API.
Definition: cs_ast.hpp:33
Enumeration class describing the significance setting for a warning class.
Definition: csonar_warningclass.hpp:356
static const cfg_path_node_flags NEW_PATH
This node starts a new path (that is, it is not the CFG path successor of the previous node in the @V...
Definition: csonar_warningclass.hpp:128
static const locations_node_flags STYLE3
Singleton set containing the "style3" flag: this location should be rendered in the alternate style3 ...
Definition: csonar_warningclass.hpp:218
Manages the warning classes (warningclass) and visitors (visitor) @PYSTART@ (see ...
Definition: csonar_visitor.hpp:2108
Describes the cases in which a warning instance should be retracted.
Definition: csonar_warningclass.hpp:511
static const warningclass_flags SHOW_ENTIRE_PROCEDURE
Singleton set containing the "show entire procedure" flag: if any part of a procedure appears on a pa...
Definition: csonar_warningclass.hpp:286
Flag class used by a number of warningclass report() and report_return_warning() methods.
Definition: csonar_warningclass.hpp:31
static const warningclass_flags FORCE_PATH
Singleton set containing the "force_path" flag: warnings of this class will always be treated as "pat...
Definition: csonar_warningclass.hpp:316
static const locations_node_flags INTERPOLATE_STYLE
Singleton set containing the "interpolate style" flag: the specified style should be heuristically ap...
Definition: csonar_warningclass.hpp:231
std
Definition: cs_ast_decl.hpp:67
A single program point.
Definition: cs_point_decl.hpp:66
std::string as_string() const
Get a simple string representation of a cfg_path_node object.
Definition: csonar_warningclass.hpp:817
void retract()
Manually retract a warning instance.
Definition: csonar_warningclass.hpp:447
static const cfg_path_node_flags ENDBOX
The GUI should display an end box at this location (rather than an event box):
Definition: csonar_warningclass.hpp:94
std::string as_string() const
Get a simple string representation of a warning_retraction_info object.
Definition: csonar_warningclass.hpp:652
A single procedure/function/method.
Definition: cs_procedure_decl.hpp:173
static const locations_node_flags ENDBOX
Singleton set containing the "endbox" flag: the GUI should display an end box at this location (rathe...
Definition: csonar_warningclass.hpp:182
static const warningclass_flags PAD_BELOW
Singleton set containing the "pad below" flag: In the warning report, pad after the end of the warnin...
Definition: csonar_warningclass.hpp:296
Flag class: describes properties of a warningclass.
Definition: csonar_warningclass.hpp:259
std::ostream & operator<<(std::ostream &out, const ast_family &a)
Print a representation of a ast_family object to the specified stream.
Definition: cs_ast_decl.hpp:67
std::string get_event() const
Get the event string from a cfg_path_node.
Definition: csonar_warningclass.hpp:792
static const warningclass_flags NONE
Empty set: contains no flags.
Definition: csonar_warningclass.hpp:274
std::string as_repr() const
Get a representation of a cfg_path_node object that includes information useful for debugging...
Definition: csonar_warningclass.hpp:807
point get_source_point() const
Get the source point from a cfg_path_node.
Definition: csonar_warningclass.hpp:774
warning(const std::string &serialized)
Constructor.
Definition: csonar_warningclass.hpp:404
cs_column column_number
A character position in a line (line_number) of a source file instance (sfileinst).
Definition: cs_types.hpp:378
static const warningclass_flags PADDING
Set containing the "pad below" and "pad above" flags: in the warning report, pad both before and afte...
Definition: csonar_warningclass.hpp:301
static const locations_node_flags STYLE2
Singleton set containing the "style2" flag: this location should be rendered in the alternate style2 ...
Definition: csonar_warningclass.hpp:213
static const cfg_path_node_flags PRIMARY
The event at this location is a "primary event" and should be displayed by default in the GUI Warning...
Definition: csonar_warningclass.hpp:107
int cmp(const warningclass &other) const
Comparison function for warningclass.
Definition: csonar_warningclass.hpp:1845
Enumeration class describing the mode of a CodeSonar analysis process.
Definition: csonar_warningclass.hpp:338
static const cfg_path_node_flags DONT_MARK_CONTRIBUTING
This location should not be additionally highlighted in the code listing.
Definition: csonar_warningclass.hpp:100
Enumeration class describing the multiprocess mode of a CodeSonar analysis process.
Definition: csonar_warningclass.hpp:340
Flag class: characterizes a cfg_path_node.
Definition: csonar_warningclass.hpp:66
static const point_syntax_element NONE
All other program points.
Definition: cs_point_syntax_element_decls.hpp:21
std::vector< cs::locations_node > locations_node_vector
A std::vector of cs::locations_node.
Definition: csonar_warningclass.hpp:1085
static const report_flags DONT_MARK_CONTRIBUTING
This location should not be additionally highlighted in the code listing.
Definition: csonar_warningclass.hpp:53
static const locations_node_flags STYLE1
Singleton set containing the "style1" flag: this location should be rendered in the alternate style1 ...
Definition: csonar_warningclass.hpp:208
std::string as_repr() const
Get a representation of a warning_retraction_info object that includes information useful for debuggi...
Definition: csonar_warningclass.hpp:641
static const report_flags ALREADY_XML_ENCODED
Special characters such as &#39;<&#39; and &#39;>&#39; are already XML-escaped in the &#39;problem&#39; string.
Definition: csonar_warningclass.hpp:45
static const cfg_path_node_flags NONE
Use this if you don&#39;t want any other flags.
Definition: csonar_warningclass.hpp:81
static const warningclass_flags WARNING_POINT_IS_START_POINT
The start point of the path is most interesting (not the end point).
Definition: csonar_warningclass.hpp:280
A node on a CFG path.
Definition: csonar_warningclass.hpp:695
The result of an API operation.
Definition: cs_result.hpp:50
static const warningclass_flags PAD_ABOVE
Singleton set containing the "pad above" flag: in the warning report, pad before the beginning of the...
Definition: csonar_warningclass.hpp:291
static const locations_node_flags STYLE0
Singleton set containing the "style0" flag: this location should be rendered in the style0 style...
Definition: csonar_warningclass.hpp:203
static const cfg_path_node_flags CONTRIBUTES
This location contributes to a warning path.
Definition: csonar_warningclass.hpp:113
static const locations_node_flags PRIMARY
Singleton set containing the "primary" flag: the event at this location is a "primary event" and shou...
Definition: csonar_warningclass.hpp:191
static const locations_node_flags DONT_MARK_CONTRIBUTING
Singleton set containing the "don&#39;t mark contributing" flag: this location should not be additionally...
Definition: csonar_warningclass.hpp:198
Used by the warningclass report() and report_return_warnings() methods that report a warning with a s...
Definition: csonar_warningclass.hpp:1163
Used by warningclass report() and report_return_warnings() methods that report a warning with a list ...
Definition: csonar_warningclass.hpp:890
A source file instance.
Definition: cs_sfileinst_decl.hpp:302
static const locations_node_flags APPLY_STYLE_TO_LINE
Singleton set containing the "apply style to line" flag: the specified style will be applied to the e...
Definition: csonar_warningclass.hpp:236
std::vector< cs::cfg_path_node > cfg_path_node_vector
A std::vector of cs::cfg_path_node.
Definition: csonar_warningclass.hpp:821
edge_label get_edge_label() const
Get the edge label from a cfg_path_node.
Definition: csonar_warningclass.hpp:781
Flag class: describes properties of a locations_node.
Definition: csonar_warningclass.hpp:146
A warning instance.
Definition: csonar_warningclass.hpp:388
static const locations_node_flags NONE
Empty set: contains no flags.
Definition: csonar_warningclass.hpp:166
A warning class.
Definition: csonar_warningclass.hpp:1353
std::string serialize(void) const
Serialize a warning instance.
Definition: csonar_warningclass.hpp:422
cfg_path_node_flags get_flags() const
Get the flags from a cfg_path_node.
Definition: csonar_warningclass.hpp:799