Changes between Version 23 and Version 24 of MapGuideCodingStandards


Ignore:
Timestamp:
Jul 24, 2008, 1:34:53 PM (16 years ago)
Author:
tomfukushima
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MapGuideCodingStandards

    v23 v24  
    6767///Description of parameter element
    6868///</param>
    69 ///<param name="sFileName">
    70 ///Description of parameter sFileName
     69///<param name="fileName">
     70///Description of parameter fileName
    7171///</param>
    7272/// <returns></returns>
    73 private bool CanIgnoreElement(Element element, string sFileName)
     73private bool CanIgnoreElement(Element element, string fileName)
    7474}}}
    7575
     
    219219== IDE Settings ==
    220220
    221 It is recommended that you use Visual Studio .NET for software development on Windwos and it helps if some settings are the same for all users.  Here are the ones you should make sure are set.
     221It is recommended that you use Visual Studio .NET for software development on Windows and it helps if some settings are the same for all users.  Here are the ones you should make sure are set.
    222222
    223223Under Tools/Options/Text Editor/All Languages/Tabs, make sure the tab size is set to 4 and that the ‘Insert spaces’ option is turned on.  The use of spaces everywhere rather than a mix of tabs and spaces has the following advantages:
     
    468468}}}
    469469
    470 A try-catch statement may also be followed by `finally` which is always executed.
     470A try-catch statement may also be followed by `finally` which is always executed (unless an exception is thrown in the body of an executed catch).
    471471{{{
    472472#!cpp
     
    546546
    547547A pointer should always be checked before using. You should never assume that the pointer will be valid.
    548 This is a good coding style and should be done.
    549 {{{
    550 #!cpp
    551 if (pData != NULL)
    552 {
    553     int nSize = pData->GetSize();
     548This is good coding style and should be done.
     549{{{
     550#!cpp
     551if (NULL != data)  // note order of operands in the expression
     552{
     553    int size = data->GetSize();
    554554    ...
    555555}
     
    559559{{{
    560560#!cpp
    561 int nSize = pData->GetSize();
     561int size = data->GetSize();
    562562}}}
    563563
     
    580580MgRepository* MgServerResourceService::CreateRepository(CREFSTRING repositoryType, CREFSTRING repositoryName)
    581581{
    582     Ptr<MgRepository> repository = 0;
     582    Ptr<MgRepository> repository;
    583583
    584584    MG_RESOURCE_SERVICE_TRY()
    585 
    586     MgResourceServiceUtil::CheckArgument(!repositoryName.empty());
    587585
    588586    if (MgRepositoryType::Library == repositoryType)
     
    596594    else
    597595    {
    598         throw new MgInvalidRepositoryTypeException(__FILE__, __LINE__);
     596        throw new MgInvalidRepositoryTypeException(__LINE__, __WFILE__);
    599597    }
    600598
    601     MgResourceServiceUtil::CheckMemory(repository);
    602 
    603599    MG_RESOURCE_SERVICE_CATCH_AND_THROW()
    604600
    605     assert(0 == mgException);
    606 
    607     (*repository).AddRef();     // Ownership is transferred to the caller
    608 
    609     return repository;
     601    return repository.Detach();
    610602}
    611603}}}
     
    654646    MG_CATCH()
    655647
    656     if (0 != mgException)
     648    if (NULL != mgException)
    657649    {
    658650        delete[] bar;
    659         throw mgException;
     651        (*mgException).AddRef();
     652        mgException->Raise();
    660653    }
    661654
     
    751744{
    752745    mdXY = 0,   /// XY
    753     mdXYM,              /// XY + Measure
    754     mdXYZ,              /// XYZ
    755     mdXYZM,             /// XYZ + Measure
     746    mdXYM,      /// XY + Measure
     747    mdXYZ,      /// XYZ
     748    mdXYZM,     /// XYZ + Measure
    756749};
    757750}}}