Changes between Version 23 and Version 24 of MapGuideCodingStandards
- Timestamp:
- 07/24/08 13:34:53 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MapGuideCodingStandards
v23 v24 67 67 ///Description of parameter element 68 68 ///</param> 69 ///<param name=" sFileName">70 ///Description of parameter sFileName69 ///<param name="fileName"> 70 ///Description of parameter fileName 71 71 ///</param> 72 72 /// <returns></returns> 73 private bool CanIgnoreElement(Element element, string sFileName)73 private bool CanIgnoreElement(Element element, string fileName) 74 74 }}} 75 75 … … 219 219 == IDE Settings == 220 220 221 It is recommended that you use Visual Studio .NET for software development on Wind wos and it helps if some settings are the same for all users. Here are the ones you should make sure are set.221 It 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. 222 222 223 223 Under 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: … … 468 468 }}} 469 469 470 A try-catch statement may also be followed by `finally` which is always executed .470 A 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). 471 471 {{{ 472 472 #!cpp … … 546 546 547 547 A pointer should always be checked before using. You should never assume that the pointer will be valid. 548 This is agood coding style and should be done.549 {{{ 550 #!cpp 551 if ( pData != NULL)552 { 553 int nSize = pData->GetSize();548 This is good coding style and should be done. 549 {{{ 550 #!cpp 551 if (NULL != data) // note order of operands in the expression 552 { 553 int size = data->GetSize(); 554 554 ... 555 555 } … … 559 559 {{{ 560 560 #!cpp 561 int nSize = pData->GetSize();561 int size = data->GetSize(); 562 562 }}} 563 563 … … 580 580 MgRepository* MgServerResourceService::CreateRepository(CREFSTRING repositoryType, CREFSTRING repositoryName) 581 581 { 582 Ptr<MgRepository> repository = 0;582 Ptr<MgRepository> repository; 583 583 584 584 MG_RESOURCE_SERVICE_TRY() 585 586 MgResourceServiceUtil::CheckArgument(!repositoryName.empty());587 585 588 586 if (MgRepositoryType::Library == repositoryType) … … 596 594 else 597 595 { 598 throw new MgInvalidRepositoryTypeException(__ FILE__, __LINE__);596 throw new MgInvalidRepositoryTypeException(__LINE__, __WFILE__); 599 597 } 600 598 601 MgResourceServiceUtil::CheckMemory(repository);602 603 599 MG_RESOURCE_SERVICE_CATCH_AND_THROW() 604 600 605 assert(0 == mgException); 606 607 (*repository).AddRef(); // Ownership is transferred to the caller 608 609 return repository; 601 return repository.Detach(); 610 602 } 611 603 }}} … … 654 646 MG_CATCH() 655 647 656 if ( 0!= mgException)648 if (NULL != mgException) 657 649 { 658 650 delete[] bar; 659 throw mgException; 651 (*mgException).AddRef(); 652 mgException->Raise(); 660 653 } 661 654 … … 751 744 { 752 745 mdXY = 0, /// XY 753 mdXYM, 754 mdXYZ, 755 mdXYZM, 746 mdXYM, /// XY + Measure 747 mdXYZ, /// XYZ 748 mdXYZM, /// XYZ + Measure 756 749 }; 757 750 }}}