From 0bbf3772212391cff69ed451c0a089279ee0c27c Mon Sep 17 00:00:00 2001 From: jpr Date: Thu, 6 Jan 2005 17:08:05 +0000 Subject: [PATCH] Doxygenation + modif Coding style : According with Benoit (and Doxygen) we shall use, just like anybody : T *foo or T &foo and NOT T* foo or T & foo (that was gdcm-special) --- Dicts/dicomTS.dic | 2 +- Doc/Website/CodingStyle.html | 21 +++++++++++++++------ src/gdcmBase.cxx | 6 +++--- src/gdcmDict.cxx | 24 ++++++++++++------------ 4 files changed, 31 insertions(+), 22 deletions(-) diff --git a/Dicts/dicomTS.dic b/Dicts/dicomTS.dic index b6f541c2..2e45fc78 100644 --- a/Dicts/dicomTS.dic +++ b/Dicts/dicomTS.dic @@ -25,7 +25,7 @@ 1.2.840.10008.1.2.4.90 JPEG 2000 Image Compression (Lossless Only) 1.2.840.10008.1.2.4.91 JPEG 2000 Image Compression 1.2.840.10008.1.2.5 RLE Lossless -1.2.840.113619.5.2 Implicit VR - Little Endian GE DLX xadc +1.2.840.113619.5.2 Implicit VR - Big Endian (GE Private) 1.2.840.10008.1.1 Verification SOP Class 1.2.840.10008.1.3.10 Media Storage Directory Storage diff --git a/Doc/Website/CodingStyle.html b/Doc/Website/CodingStyle.html index 53910bb9..2b53165f 100644 --- a/Doc/Website/CodingStyle.html +++ b/Doc/Website/CodingStyle.html @@ -149,7 +149,7 @@ logical blocks of code with the concerned comments. - Use parantheses around conditions e.g. with an if statement: if ( someLocalVariable == 2 ) { ... } - - Add spaces around parantheses, or braces. Use + - Add spaces around parentheses, or braces. Use if ( someLocalVariable == 2 ) { ClassMenber += 1; } and not if (someLocalVariable == 2) {ClassMenber += 1;} @@ -227,11 +227,11 @@ * dictionaries), look for the element value representation of * a given tag. * @param group Group number of the searched tag. - * @param element Element number of the searched tag. + * @param elem Element number of the searched tag. * @return Corresponding element value representation when it exists, * and the string "gdcm::Unfound" otherwise. */ - std::string Document::GetEntryByNumber(guint16 group, guint16 element) + std::string Document::GetEntryByNumber(guint16 group, guint16 elem) { ... } @@ -244,17 +244,26 @@ warnings won't work). - Don't use the C standard library. Don't include stdio.h, ctype.h... Don't use printf(), sprinf(), FILE*... - - Don't use the NULL notation (either as macro, or as const int NULL=0). + - Don't use the NULL notation (neither as macro, nor as const int NULL=0). A pointer that doesn't refer to an object should simply be defined as DataPointer* MyDataPointer = 0; * Basic types: - Assume T is a given type. When declaring or defining with the "pointer to T" notation, the * character must be adjacent to - the type and not the variable. That is use + the variable and not the type. That is use + T *foo = 0; + and not T* foo = 0; + - Assume T is a given type. When declaring or defining with the + "reference to T" notation, the & character must be adjacent to + the variable and not the type. That is use + T &foo = 0; and not - T *foo = 0; + T& foo = 0; + This is the common notation, not a 'gdcm special' notation. + (doxygen will not have any longer to correct) + - Always define a typedef for a new type and be consistent in usage. Use typedef Header* HeaderPointer; diff --git a/src/gdcmBase.cxx b/src/gdcmBase.cxx index 2d244cdf..dafc627a 100644 --- a/src/gdcmBase.cxx +++ b/src/gdcmBase.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmBase.cxx,v $ Language: C++ - Date: $Date: 2004/12/21 15:16:07 $ - Version: $Revision: 1.2 $ + Date: $Date: 2005/01/06 17:08:06 $ + Version: $Revision: 1.3 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -45,7 +45,7 @@ Base::~Base() * \brief Print all the object * @param os The output stream to be written to. */ -void Base::Print(std::ostream &) +void Base::Print(std::ostream & os) { } diff --git a/src/gdcmDict.cxx b/src/gdcmDict.cxx index 19b93639..78c3f3f3 100644 --- a/src/gdcmDict.cxx +++ b/src/gdcmDict.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: gdcmDict.cxx,v $ Language: C++ - Date: $Date: 2004/11/16 02:54:35 $ - Version: $Revision: 1.52 $ + Date: $Date: 2005/01/06 17:08:06 $ + Version: $Revision: 1.53 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -30,10 +30,10 @@ void FillDefaultDataDict(Dict *d); //----------------------------------------------------------------------------- // Constructor / Destructor /** - * \brief Construtor + * \brief Constructor * @param filename from which to build the dictionary. */ -Dict::Dict(std::string const & filename) +Dict::Dict(std::string const &filename) { uint16_t group; uint16_t element; @@ -123,7 +123,7 @@ void Dict::PrintByKey(std::ostream &os) * unpredictable result * @param os The output stream to be written to. */ -void Dict::PrintByName(std::ostream& os) +void Dict::PrintByName(std::ostream &os) { std::ostringstream s; @@ -148,9 +148,9 @@ void Dict::PrintByName(std::ostream& os) * @param newEntry entry to add * @return false if Dicom Element already exists */ -bool Dict::AddNewEntry(DictEntry const & newEntry) +bool Dict::AddNewEntry(DictEntry const &newEntry) { - const TagKey & key = newEntry.GetKey(); + const TagKey &key = newEntry.GetKey(); if(KeyHt.count(key) == 1) { @@ -171,7 +171,7 @@ bool Dict::AddNewEntry(DictEntry const & newEntry) * @param newEntry new entry (overwrites any previous one with same tag) * @return false if Dicom Element doesn't exist */ -bool Dict::ReplaceEntry(DictEntry const & newEntry) +bool Dict::ReplaceEntry(DictEntry const &newEntry) { if ( RemoveEntry(newEntry.GetKey()) ) { @@ -189,7 +189,7 @@ bool Dict::ReplaceEntry(DictEntry const & newEntry) * @param key (group|element) * @return false if Dicom Dictionary Entry doesn't exist */ -bool Dict::RemoveEntry (TagKey const & key) +bool Dict::RemoveEntry (TagKey const &key) { TagKeyHT::const_iterator it = KeyHt.find(key); if(it != KeyHt.end()) @@ -227,7 +227,7 @@ bool Dict::RemoveEntry (uint16_t group, uint16_t element) * the name MAY CHANGE between two versions ! * @return the corresponding dictionnary entry when existing, NULL otherwise */ -DictEntry* Dict::GetDictEntryByName(TagName const & name) +DictEntry *Dict::GetDictEntryByName(TagName const &name) { TagNameHT::iterator it = NameHt.find(name); if ( it == NameHt.end() ) @@ -243,7 +243,7 @@ DictEntry* Dict::GetDictEntryByName(TagName const & name) * @param element element of the entry to be found * @return the corresponding dictionnary entry when existing, NULL otherwise */ -DictEntry* Dict::GetDictEntryByNumber(uint16_t group, uint16_t element) +DictEntry *Dict::GetDictEntryByNumber(uint16_t group, uint16_t element) { TagKey key = DictEntry::TranslateToKey(group, element); TagKeyHT::iterator it = KeyHt.find(key); @@ -260,7 +260,7 @@ DictEntry* Dict::GetDictEntryByNumber(uint16_t group, uint16_t element) * \sa DictSet::GetPubDictTagNamesByCategory * @return A list of all entries of the public dicom dictionnary. */ -EntryNamesList* Dict::GetDictEntryNames() +EntryNamesList *Dict::GetDictEntryNames() { EntryNamesList *result = new EntryNamesList; for (TagKeyHT::iterator tag = KeyHt.begin(); tag != KeyHt.end(); ++tag) -- 2.45.1